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/ClsEncuestas.vb b/App_Code/ClsEncuestas.vb index 119c69534..a5848e63b 100644 --- a/App_Code/ClsEncuestas.vb +++ b/App_Code/ClsEncuestas.vb @@ -411,7 +411,7 @@ Public Class ClsEncuestas Dim Retorno As Boolean = False DataAdapter("PA_Enc_EncuestasRespuestasGet", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters - .Add("@CveEncuesta", SqlDbType.VarChar).Value = CveEncuesta + .Add("@CveEncuesta", SqlDbType.Int).Value = CveEncuesta End With Try SqlAdapter.Fill(Data) @@ -426,7 +426,7 @@ Public Class ClsEncuestas Dim Retorno As Boolean = False DataAdapter("PA_Enc_EncuestasRespuestasUpdate", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters - .Add("@CveRespuesta", SqlDbType.VarChar).Value = CveRespuesta + .Add("@CveRespuesta", SqlDbType.Int).Value = CveRespuesta .Add("@Respuesta", SqlDbType.VarChar).Value = Respuesta .Add("@CvePregunta", SqlDbType.Int).Value = CvePregunta End With @@ -444,7 +444,7 @@ Public Class ClsEncuestas Dim Retorno As Boolean = False DataAdapter("PA_Enc_EncuestasRespuestasRemove", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters - .Add("@CveRespuesta", SqlDbType.VarChar).Value = CveRespuesta + .Add("@CveRespuesta", SqlDbType.Int).Value = CveRespuesta End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 1f953f6de..47bb3a961 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -261,6 +261,51 @@ Public Class ClsGenerales End Try Return retorno End Function + + Public Function GetMotivosCancelacionSAT() As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Gral_SAT_MotivosCancelacionGet") + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los motivos de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function GetMotivosCancelacionEmpresa(CveEmpresa As Integer, Optional CveMotivoCancelacion As Integer = -1, Optional CveSATMotivoCancelacion As Integer = -1) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Gral_MotivosCancelacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion + .Add("@CveSATMotivoCancelacion", SqlDbType.Int).Value = CveSATMotivoCancelacion + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los motivos de cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + Public Function GenerarMotivosCancelacionEmpresaDefault(CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Gral_MotivosCancelacionDefaultAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar los motivos de cancelacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + #Region " I N D I C A D O R E S Y G R A F I C A S" Public Function GetIndicadores(CveEmpresa As Integer) As DataSet 'Dim Retorno As Boolean = False diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 02b791de4..209735f2c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1730,7 +1730,7 @@ Public Class ClsInventarios Public Function RepMovimientos(CveEmpresa As Integer, CveMoneda As Integer, FechaI As String, FechaF As String, CveConcepto As Integer, CveProveedor As Integer, Almacenes As String, - CveFamilia As Integer, CveSubFamilia As Integer, CvePS As Integer, CveClasificacion As Integer, Tipo As Integer, Optional CveMarca As Integer = -1, Optional CvePersonal As Integer = -1, + CveCategoria As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer, Optional CveMarca As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion2 As Integer = -1, Optional CveTipoAlmacen As String = "-1", Optional Modalidad As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1745,8 +1745,8 @@ Public Class ClsInventarios .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor .Add("@Almacenes", SqlDbType.VarChar).Value = Almacenes - .Add("@CveFamilia", SqlDbType.Int).Value = CveFamilia - .Add("@CveSubFamilia", SqlDbType.Int).Value = CveSubFamilia + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria + ' .Add("@CveSubFamilia", SqlDbType.Int).Value = CveSubFamilia .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb index 50259e4c7..295d3bfcc 100644 --- a/App_Code/ClsMovimientos.vb +++ b/App_Code/ClsMovimientos.vb @@ -1279,7 +1279,7 @@ Public Class ClsMovimientos CveEstatusFactura As Integer, Fecha As String, Agrupador As Integer, Opcion As String, CveEmpresa As Integer, CveSucursal As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1, Optional CveTipoProveedor As Integer = -1, - Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1) As Boolean + Optional Comprobaciones As Integer = -1, Optional AplicaNC As Integer = -1, Optional TipoDocto As String = "-1") As Boolean Dim Retorno As Boolean = False If FechaCorte = Nothing Then FechaCorte = Now @@ -1312,7 +1312,8 @@ Public Class ClsMovimientos .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor .Add("@Comprobaciones", SqlDbType.Int).Value = Comprobaciones - .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC + .Add("@AplicaNC", SqlDbType.Int).Value = AplicaNC + .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto End With Try diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index ed48b6e96..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, diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1bc365482..480f0dcaf 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -1140,6 +1140,76 @@ Public Class ClsPaginas 'ObjUnidadesMedida.Dispose() End Set End Property + + Public Shared Property GlobalDTSATMotivosCancelacion(Optional CveSATMotivoCancelacion As Integer = -1, Optional CodigoSAT As String = "-1") As DataTable + Get + If HttpContext.Current.Application("GlobalDTSATMotivosCancelacion") Is Nothing Then + Using ObjGral As New ClsGenerales + If ObjGral.GetMotivosCancelacionSAT() Then + HttpContext.Current.Application("GlobalDTSATMotivosCancelacion") = ObjGral.DtResultados.Copy() + End If + End Using + End If + + If CveSATMotivoCancelacion <> -1 OrElse CodigoSAT <> "-1" Then + Dim StrSQL As New StringBuilder + StrSQL.Append("1=1") + If CveSATMotivoCancelacion <> -1 Then StrSQL.AppendFormat(" AND CveSATMotivoCancelacion = {0}", CveSATMotivoCancelacion) + If CodigoSAT <> "-1" Then StrSQL.AppendFormat(" AND CodigoSAT = '{0}'", CodigoSAT) + + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATMotivosCancelacion"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), " CveSATMotivoCancelacion", DataViewRowState.CurrentRows) + GlobalDTSATMotivosCancelacion = Dv.ToTable + Dv.Dispose() + Else + GlobalDTSATMotivosCancelacion = DirectCast(HttpContext.Current.Application("GlobalDTSATMotivosCancelacion"), DataTable) + End If + + End Get + Set(ByVal value As DataTable) + HttpContext.Current.Application("GlobalDTSATMotivosCancelacion") = value + End Set + End Property + + Public Shared Property GlobalDTMotivosCancelacionEmpresa(CveEmpresa As Integer, Optional CveMotivoCancelacion As Integer = -1, Optional CveSATMotivoCancelacion As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTMotivosCancelacionEmpresa-{0}", CveEmpresa) + 'sino existe, recarga los datos + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim ObjGral As New ClsGenerales() + If ObjGral.GetMotivosCancelacionEmpresa(CveEmpresa) Then + 'SI NO TIENE, GENERA LOS MOTIVOS + If ObjGral.DtResultados.Rows.Count = 0 Then + If ObjGral.GenerarMotivosCancelacionEmpresaDefault(CveEmpresa) Then + If ObjGral.GetMotivosCancelacionEmpresa(CveEmpresa) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then + HttpContext.Current.Application(AppNombre) = ObjGral.DtResultados + End If + End If + Else + HttpContext.Current.Application(AppNombre) = ObjGral.DtResultados + End If + End If + ObjGral.Dispose() + End If + + If HttpContext.Current.Application(AppNombre) IsNot Nothing Then + Dim Str As New StringBuilder + Str.AppendFormat(" 1 = 1 ") + If CveMotivoCancelacion > 0 Then Str.AppendFormat(" AND CveMotivoCancelacion = {0}", CveMotivoCancelacion) + If CveSATMotivoCancelacion > 0 Then Str.AppendFormat(" AND CveSATMotivoCancelacion = {0}", CveSATMotivoCancelacion) + + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTMotivosCancelacionEmpresa = Dv.ToTable + Dv.Dispose() + Else + GlobalDTMotivosCancelacionEmpresa = Nothing + End If + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTMotivosCancelacionEmpresa-{0}", CveEmpresa) + HttpContext.Current.Application(AppNombre) = value + End Set + End Property Property GlobalDTEstatusOrdenCompra() As DataTable Get GlobalDTEstatusOrdenCompra = DirectCast(Application("GlobalDTEstatusOrdenCompra"), DataTable) @@ -2482,19 +2552,29 @@ Public Class ClsPaginas #Region "***********************************************************************DT GENERALES**************************************************************************************" Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable - Get - If CveEmpresa <> -1 Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTGralCategorias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) - GlobalDTGralCategorias = Dv.ToTable - Dv.Dispose() - Else - GlobalDTGralCategorias = DirectCast(Application("GlobalDTGralCategorias"), DataTable) + Dim AppNombre As String = String.Format("GlobalDTGralCategorias-{0}", CveEmpresa) + 'sino existe, recarga los datos + If DirectCast(Application(AppNombre), DataTable) Is Nothing Then + Dim ObjGenerales As New ClsGenerales + If ObjGenerales.GetCategorias(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados Else Application(AppNombre) = Nothing + ObjGenerales.Dispose() End If + + Dim filtro As New StringBuilder + 'If CveMarca > 0 Then + ' filtro.AppendFormat(" CveMarca={0} ", CveMarca) + 'End If + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTGralCategorias = Dv.ToTable + Dv.Dispose() End Get Set(value As DataTable) - Application("GlobalDTGralCategorias") = value + Dim AppNombre As String = String.Format("GlobalDTGralCategorias-{0}", CveEmpresa) + Application(AppNombre) = value End Set + End Property Property GlobalDTGralCategorias2(CveEmpresa As Integer) As DataTable 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/ClsVentas.vb b/App_Code/ClsVentas.vb index ad1c04887..2c95cc3fd 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -241,6 +241,26 @@ Public Class ClsVentas Return Retorno End Function + + Public Function GetVentasPendientesCancelacion(CveEmpresa As Integer, CveUsuarioConsulta As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasPendientesCancelacionGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las Ventas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetVentaComplementos() As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ComplementosGet") @@ -701,7 +721,8 @@ Public Class ClsVentas End Function Public Function UpdateEstatusFactura(Estatus As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveVenta As Integer, Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, - Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1") As Boolean + Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1", + Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasUpdateEstatus") @@ -718,6 +739,8 @@ Public Class ClsVentas .Add("@CveUsuarioCambiaEstatus", SqlDbType.Int).Value = CveUsuarioCambiaEstatus .Add("@FechaCambioEstatus", SqlDbType.VarChar).Value = FechaCambioEstatus .Add("@RFCReceptor", SqlDbType.VarChar).Value = RFCReceptor + .Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion + .Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion End With Try @@ -2732,9 +2755,9 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean Dim Retorno As Boolean = False - DataAdapter("Vta_RepRemisionesGet") + DataAdapter("PA_Vta_RepRemisionesGet") With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.VarChar).Value = FechaI @@ -2746,6 +2769,7 @@ Public Class ClsVentas .Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario End With Try @@ -2757,9 +2781,9 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepRemisionesSinFacturarDetalle(FechaI As String, FechaF As String, FechaV As String, CveCliente As Integer, CveContrato As Integer, CveVenta As Integer, CveEmpresa As Integer, CveSubProyecto As String, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepRemisionesSinFacturarDetalle(FechaI As String, FechaF As String, FechaV As String, CveCliente As Integer, CveContrato As Integer, CveVenta As Integer, CveEmpresa As Integer, CveSubProyecto As String, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean Dim Retorno As Boolean = False - DataAdapter("Vta_RepRemisionesDetalleGet") + DataAdapter("PA_Vta_RepRemisionesDetalleGet") With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.VarChar).Value = FechaI @@ -2771,6 +2795,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario End With Try @@ -2845,7 +2870,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadGet") @@ -2857,6 +2882,7 @@ Public Class ClsVentas .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With @@ -2873,7 +2899,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadDetalleGet") With SqlAdapter.SelectCommand.Parameters @@ -2885,6 +2911,7 @@ Public Class ClsVentas .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With @@ -2904,7 +2931,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean + Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepVentasUtilidadGet") @@ -2917,6 +2944,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Gpo", SqlDbType.Int).Value = Gpo .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveCategoria", SqlDbType.Int).Value = CveCategoria .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With @@ -3033,6 +3061,24 @@ Public Class ClsVentas Return OnError End Function + Public Function GetFacturasRelacionadasPorFolioFiscal(FoliosFiscales As String, CveEmpresa As Integer) As Boolean + Dim OnError As Boolean = False + DataAdapter("PA_Vta_FacturasRelacionadasPorFolioFiscalGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@FoliosFiscales", SqlDbType.VarChar).Value = FoliosFiscales + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + OnError = True + Catch ex As Exception + Me.OnError("Ocurrió un error al obtener las facturas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return OnError + End Function + Public Function GetFacturasCanceladasPendientesWS(RFC As String, CveEmpresa As Integer, Optional showalert As Boolean = True) As Boolean Dim retorno As Boolean = False Try @@ -3072,6 +3118,8 @@ Public Class ClsVentas Return retorno End Function + + Public Function UpdateVentaFacturas(CveFactura As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean Dim OnError As Boolean = False diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 64d2400a6..233100246 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4585,14 +4585,14 @@ Namespace Modelos End If ObjVentas.Dispose() - Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=Me.RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusFacturaAsignado:=CveEstatus, FechaCancelacion:=FechaCancelacion.ToString("dd/MM/yyyy hh:mm:ss"), AcuseCancelacion:=AcuseCancelacion) + Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=Me.RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusFacturaAsignado:=CveEstatus, FechaCancelacion:=FechaCancelacion.ToString("dd/MM/yyyy hh:mm:ss"), AcuseCancelacion:=AcuseCancelacion, CveMotivoCancelacion:=Me.CveMotivoCancelacion, MotivoCancelacion:=Me.MotivoCancelacion) End Function ''' ''' Cancela la factura para poder realizar la refacturacion ''' ''' - Public Function CancelarPorRefacturacion() As MCancelacionVentaMensaje - Return CancelarVenta(Me, Me.UsuarioActual, EsRefacturacion:=True) + Public Function CancelarPorRefacturacion(CveMotivoCancelacion As Integer, Motivo As String, Optional FolioSustitucion As String = "") As MCancelacionVentaMensaje + Return CancelarVenta(Me, Me.UsuarioActual, EsRefacturacion:=True, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, FolioSustitucion:=FolioSustitucion) End Function ''' ''' Cancela la factura y realiza las operaciones correspondientes @@ -4600,13 +4600,15 @@ Namespace Modelos ''' ''' ''' - Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing) As MCancelacionVentaMensaje - Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar) + Public Function CancelarFactura(RealizarDevolucionAlmacen As Boolean, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "") As MCancelacionVentaMensaje + 'Comprobante emitido con errores sin relación + Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo) End Function Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Boolean = False, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveEstatusFacturaAsignado As Integer = -1, - Optional FechaCancelacion As String = "-1", Optional AcuseCancelacion As String = "") As MCancelacionVentaMensaje + Optional FechaCancelacion As String = "-1", Optional AcuseCancelacion As String = "", + Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional FolioSustitucion As String = "") As MCancelacionVentaMensaje Dim Retorno As New MCancelacionVentaMensaje() Dim ErrorList As New List(Of String) @@ -4783,9 +4785,23 @@ Namespace Modelos Dim RequiereAceptacion As Boolean = False Dim Mensaje As String = "" + Dim CveSATMotivoCancelacion As Integer = -1 + + If CveMotivoCancelacion > 0 Then + Dim Row As DataRow = ClsPaginas.GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveMotivoCancelacion:=CveMotivoCancelacion).FiltroPrimero("") + If Row IsNot Nothing Then + CveSATMotivoCancelacion = Row("CveSATMotivoCancelacion").ToString().ToEntero() + End If + End If + + 'SI YA ESTA TIMBRADA, NUEVO PROCESO REFACTURACION, ASIGNA LA CANCELACION PENDIENTE + If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 Then + CveEstatusFacturaAsignado = 23 + End If + If CveEstatusFacturaAsignado <= 0 Then Try - If ObjFactura.FolioFiscal <> "" AndAlso UsuarioActual.Empresa.FacturaProduccion Then + If ObjFactura.FolioFiscal <> "" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then If ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then 'VERIFICA SI DEBE VALIDAR ANTE EL SAT @@ -4865,7 +4881,7 @@ Namespace Modelos If Not ObtenerAcuse Then If ContinuarCancelacion Then - If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then + If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, TotalT, RFCReceptor, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion, FolioSustitucion:=FolioSustitucion) Then 'GENERAMOS EL ACUSE Y MANDAMOS MAIL DE CON EL ACUSE DE CANCELACIÓN If RequiereAceptacion Then CancelacionFecha = Now.Date @@ -4906,7 +4922,7 @@ Namespace Modelos End Try Else CveEstatus = CveEstatusFacturaAsignado - CancelacionFecha = FechaCancelacion.ToDateTime() + CancelacionFecha = If(IsDate(FechaCancelacion), FechaCancelacion, Now.ToString("dd/MM/yyyy")).ToDateTime() CancelacionAcuse = AcuseCancelacion End If @@ -4936,7 +4952,7 @@ Namespace Modelos End If 'SI ES CANCELACION EN PROCESO CANCELA EL PROCESO DE LAS REMISIONES - Dim SeCancelaRemisionProceso = (CveEstatus = 20 AndAlso TieneRemisionesRelacionadas AndAlso CancelarRemisiones) + Dim SeCancelaRemisionProceso = (CveEstatus.Contiene(20, 23) AndAlso TieneRemisionesRelacionadas AndAlso CancelarRemisiones) Retorno.CveEstatus = CveEstatus @@ -4972,7 +4988,7 @@ Namespace Modelos End If 'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO - If Not AplicaRefacturacionConPagos AndAlso ((((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20)) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20))) Then + If Not AplicaRefacturacionConPagos AndAlso ((((ObjFactura.Saldo > 0 AndAlso (CveEstatus > 0 AndAlso Not CveEstatus.Contiene(20, 23))) OrElse (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing"))) AndAlso CveEstatus.Contiene(4, 5)) OrElse (CvePlantillaPoliza = 7 AndAlso (CveEstatus > 0 AndAlso Not CveEstatus.Contiene(20, 23)))) Then 'CUANDO SE CANCELA, LA PÓLIZA DEBE DE SER DE DIARIO CvePrePoliza = ObjConta.AddPrePolizas("Modelos/CancelarDocumento", CvePlantillaPoliza, ObjFactura.Total, ObjFactura.Total, ObjFactura.CveMoneda, Now, ObjFactura.Cliente.Nombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) @@ -5009,7 +5025,7 @@ Namespace Modelos End If 'CUANDO LA CANCELACION ESTA EN PROCESO NO DEBE REALIZAR NADA DE ESTE PROCESO - If Not ErrorCancelar AndAlso Not EsRefacturacion AndAlso (CveEstatus > 0 AndAlso CveEstatus <> 20) AndAlso CveEstatusRefacturacion = 0 Then + If Not ErrorCancelar AndAlso Not EsRefacturacion AndAlso (CveEstatus > 0 AndAlso Not CveEstatus.Contiene(20, 23)) AndAlso CveEstatusRefacturacion = 0 Then 'DEVOLUCION DE ALMACEN If Not ErrorCancelar AndAlso TieneAlmacen Then @@ -5477,26 +5493,28 @@ Namespace Modelos 'ACTUALIZA ESTATUS If Not ErrorCancelar Then - Select Case ObjFactura.TipoDocto - Case "Rem" - CveEstatus = 12 - Case "Com" - CveEstatus = 9 - Case "Cot" - CveEstatus = 10 - Case "Ped", "DPe" - CveEstatus = 14 - End Select + If CveEstatus <> 23 Then + Select Case ObjFactura.TipoDocto + Case "Rem" + CveEstatus = 12 + Case "Com" + CveEstatus = 9 + Case "Cot" + CveEstatus = 10 + Case "Ped", "DPe" + CveEstatus = 14 + End Select + End If + If CveEstatus.Contiene(4, 5) Then - If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación." End If Else If Not ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, CancelacionAcuse, CancelacionFecha, CveVenta, IDPoliza, CvePAC:=CvePACCancelacion, CveEstatusRefacturacion:=CveEstatusRefacturacion, - CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm")) Then + CveUsuarioCambiaEstatus:=UsuarioActual.CveUsuario, FechaCambioEstatus:=Now.ToString("yyyy-MM-dd HH:mm:ss.mmm"), CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=MotivoCancelacion) Then ErrorCancelar = True MensajeError = "Ocurrió un error al guardar el estatus de cancelación." End If @@ -5797,7 +5815,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 @@ -5820,7 +5838,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 @@ -6735,6 +6753,10 @@ Namespace Modelos Public Property VentaDesglosaIEPS As Boolean + Public Property CveMotivoCancelacion As Integer = -1 + + Public Property MotivoCancelacion As String = "" + #End Region diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index c075709d5..d9fc2d0e9 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -9,7 +9,7 @@ Imports System.Xml Imports System.Data Imports System.Xml.Serialization Imports System.Net -Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte10 +Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte20 Public Class Timbrado @@ -29,20 +29,42 @@ Public Class Timbrado Public Property EstatusCancelacion As String End Class + Public Class RelacionadosPadre + Public Property Uuid As String + Public Property RfcEmisor As String + Public Property RfcReceptor As String + End Class + + Public Class RelacionadosHijo + Public Property Uuid As String + Public Property RfcEmisor As String + Public Property RfcReceptor As String + End Class + + Public Class MRespUUIDRelacionados + Public Property Codigo As Integer + Public Property Mensaje As String + Public Property Resultado As String + Public Property RelacionadosPadre As List(Of RelacionadosPadre) + Public Property RelacionadosHijo As List(Of RelacionadosHijo) + End Class + #End Region Public Shared Function VerificarVigenciaSAT(uuid As String, emisor As String, receptor As String, total As String, produccion As Boolean) As AcuseCancelacionSAT Dim Retorno As AcuseCancelacionSAT = Nothing - Dim resp As Cancelacion.AcuseSat = New Cancelacion.AcuseSat() - Using ws As Cancelacion.CancelacionSoapClient = New Cancelacion.CancelacionSoapClient + Dim resp As Cancelacion2022.AcuseSat = New Cancelacion2022.AcuseSat() + Using ws As Cancelacion2022.CancelacionSoapClient = New Cancelacion2022.CancelacionSoapClient Try If Not produccion Then - Dim PACUsuario As String = "rene.molina@adsistemas.mx" - Dim PACContrasenia As String = "rene2018" + Dim PACUsuario As String = "UserTest" + Dim PACContrasenia As String = "1234567890" resp = ws.ConsultaVigenciaTest(emisor, PACUsuario, PACContrasenia, uuid, receptor, total) Retorno = New AcuseCancelacionSAT() Else - resp = ws.ConsultaVigencia(emisor, "UserTest", "1234567890", uuid, receptor, total) + Dim PACUsuario As String = "rene.molina@adsistemas.mx" + Dim PACContrasenia As String = "rene2018" + resp = ws.ConsultaVigencia(emisor, PACUsuario, PACContrasenia, uuid, receptor, total) Retorno = New AcuseCancelacionSAT() End If Catch ex As Exception @@ -61,7 +83,53 @@ Public Class Timbrado End Using Return Retorno End Function - Public Function CFDICancelar(Empresa As Empresa, FolioFiscal As String, Total As Decimal, RFCReceptor As String, RFCEmisor As String, Optional CvePACCancelacion As Integer = 2, Optional ValidaFactura As Boolean = True) As Boolean + + Public Shared Function ConsultarUUIDRelacionados(Empresa As Empresa, FolioFiscal As String, Optional Produccion As Boolean = True) As MRespUUIDRelacionados + Dim Retorno = New MRespUUIDRelacionados() + Dim resp As Cancelacion2022.StructRelations = New Cancelacion2022.StructRelations() + + Using ws As Cancelacion2022.CancelacionSoapClient = New Cancelacion2022.CancelacionSoapClient + Try + Dim ArchivoLLave As String = $"{Empresa.Ruta}Certificados\{Empresa.ArchivoKey}" + Dim ArchivoCertificado As String = $"{Empresa.Ruta}Certificados\{Empresa.ArchivoCer}" + Dim Key As String = Empresa.ContraseñaKey + + Dim llaveByte As Byte(), certByte As Byte() + Dim llaveBase64 As String = "", certBase64 As String = "" + + llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave) + llaveBase64 = Convert.ToBase64String(llaveByte) + + certByte = System.IO.File.ReadAllBytes(ArchivoCertificado) + certBase64 = Convert.ToBase64String(certByte) + + If Not Produccion Then + Dim PACUsuario As String = "UserTest" + Dim PACContrasenia As String = "1234567890" + resp = ws.ObtieneRelacionadosTest(Empresa.RFC, PACUsuario, PACContrasenia, certBase64, llaveBase64, Key, FolioFiscal) + Else + Dim PACUsuario As String = "rene.molina@adsistemas.mx" + Dim PACContrasenia As String = "rene2018" + resp = ws.ObtieneRelacionados(Empresa.RFC, PACUsuario, PACContrasenia, certBase64, llaveBase64, Key, FolioFiscal) + End If + + Catch ex As Exception + Dim Strr As String = String.Format("Error al verificar estatus de cancelacion:{0}", ex.Message) + Strr.GuardaLog() + Return Nothing + End Try + End Using + + Dim Json As String = Newtonsoft.Json.JsonConvert.SerializeObject(resp) + + If Not String.IsNullOrEmpty(Json) Then + Retorno = Newtonsoft.Json.JsonConvert.DeserializeObject(Of MRespUUIDRelacionados)(Json) + End If + + Return Retorno + End Function + + Public Function CFDICancelar(Empresa As Empresa, FolioFiscal As String, Total As Decimal, RFCReceptor As String, RFCEmisor As String, Optional CvePACCancelacion As Integer = 2, Optional ValidaFactura As Boolean = True, Optional CveSATMotivoCancelacion As Integer = -1, Optional FolioSustitucion As String = "") As Boolean Dim Retorno As Boolean = False Dim MsgCancelacion As New StringBuilder @@ -78,6 +146,14 @@ Public Class Timbrado End If End If + Dim CodigoSATMotivoCancelacion As String = "" + + If CveSATMotivoCancelacion > 0 Then + If ClsPaginas.GlobalDTSATMotivosCancelacion(CveSATMotivoCancelacion) IsNot Nothing AndAlso ClsPaginas.GlobalDTSATMotivosCancelacion(CveSATMotivoCancelacion).Rows.Count > 0 Then + CodigoSATMotivoCancelacion = ClsPaginas.GlobalDTSATMotivosCancelacion(CveSATMotivoCancelacion).Rows(0)("CodigoSAT").ToString() + End If + End If + MsgCancelacion.AppendFormat("CvePAC:{0}", CvePACCancelacion) Select Case CvePACCancelacion @@ -415,12 +491,12 @@ Public Class Timbrado UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno If Not Empresa.FacturaProduccion Then - ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_AAA010101AAA.key" - ArchivoCertificado = $"{Empresa.Ruta}Certificados\CSD01_AAA010101AAA.cer" + ArchivoLLave = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key" + ArchivoCertificado = $"{Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer" UsuarioServicio = "UserTest" ClaveServicio = "1234567890" - UrlServicio = "http://juancalderon-001-site6.ftempurl.com/cancelacion.asmx?WSDL" + 'UrlServicio = "http://juancalderon-001-site6.ftempurl.com/cancelacion.asmx?WSDL" End If @@ -471,7 +547,7 @@ Public Class Timbrado objCan.CancelacionCfdi = True objCan.FechaCancelacion = System.DateTime.Now.AddMinutes(-120) ' operación requerida para que no se presente problemas con fechas adelantadas del PAC MsgCancelacion.AppendFormat("4.3-") - objCan.GeneraCancelacionB64(certBase64, llaveBase64, Clave, FolioFiscal) + objCan.GeneraCancelacionB64(certBase64, llaveBase64, Clave, FolioFiscal, CodigoSATMotivoCancelacion, FolioSustitucion) If (objCan.MensajeError = "") Then MsgCancelacion.AppendFormat("4.4-") objCan.CancelaCfdi(UsuarioServicio, ClaveServicio, UrlServicio, Empresa.FacturaProduccion) @@ -3241,7 +3317,7 @@ Public Class Timbrado ArchivoLLave = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.key" ArchivoCertificado = $"{UsuarioActual.Empresa.Ruta}Certificados\CSD01_ZUÑ920208KL4.cer" - UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL" '"http://108.60.211.43/rvltimbrado/service1.asmx" + UrlServicio = "https://pruebas.timbracfdi33.mx/Timbrado.asmx" End If @@ -3813,49 +3889,46 @@ Public Class Timbrado If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then - Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte - ''DATOS GENERALES + Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte Dim ComCartaPorte = New ProfactCartaPorte.CartaPorte() ComCartaPorte.TranspInternac = CType([Enum].Parse(GetType(ProfactCartaPorte.CartaPorteTranspInternac), Carta.TranspInternac), ProfactCartaPorte.CartaPorteTranspInternac) ComCartaPorte.EntradaSalidaMercSpecified = False - ComCartaPorte.ViaEntradaSalidaSpecified = False - ComCartaPorte.TotalDistRecSpecified = False + ComCartaPorte.ViaEntradaSalidaSpecified = False + ComCartaPorte.TotalDistRecSpecified = False 'UBICACIONES If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then + Dim i As Integer = 0 ComCartaPorte.Ubicaciones = New ProfactCartaPorte.CartaPorteUbicacion(Carta.Ubicaciones.Count - 1) {} For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones 'origen + ComCartaPorte.Ubicaciones(i) = New ProfactCartaPorte.CartaPorteUbicacion + ComCartaPorte.Ubicaciones(i).TipoUbicacion = CType([Enum].Parse(GetType(ProfactCartaPorte.CartaPorteUbicacionTipoUbicacion), ubica.TipoUbicacion), ProfactCartaPorte.CartaPorteUbicacionTipoUbicacion) ComCartaPorte.Ubicaciones(i).TipoEstacionSpecified = False + ComCartaPorte.Ubicaciones(i).IDUbicacion = ubica.IDUbicacion + ComCartaPorte.Ubicaciones(i).RFCRemitenteDestinatario = ubica.RFCRemitenteDestinatario + ComCartaPorte.Ubicaciones(i).NombreRemitenteDestinatario = ubica.NombreRemitenteDestinatario + ComCartaPorte.Ubicaciones(i).NumRegIdTrib = ubica.NumRegIdTrib + 'ComCartaPorte.Ubicaciones(i).ResidenciaFiscal = ubica.ResidenciaFiscal + 'ComCartaPorte.Ubicaciones(i).NumEstacion = ubica.NumEstacion + 'ComCartaPorte.Ubicaciones(i).NavegacionTrafico = ubica.NavegacionTrafico + ComCartaPorte.Ubicaciones(i).FechaHoraSalidaLlegada = ubica.FechaHoraSalidaLlegada.ToDate ComCartaPorte.Ubicaciones(i).DistanciaRecorrida = ubica.DistanciaRecorrida - 'ComCartaPorte.Ubicaciones(i).Origen = New ProfactCartaPorte.CartaPorteUbicacion With {.IDOrigen = ubica.IDOrigen, - ' .RFCRemitente = ubica.RFCRemitenteDestinatario, - ' .NombreRemitente = ubica.NombreRemitenteDestinatario, - ' .FechaHoraSalida = ubica.FechaHoraSalida.ToDate} - 'ComCartaPorte.Ubicaciones(i).Domicilio = New ProfactCartaPorte.CartaPorteUbicacionDomicilio With {.Calle = ubica.Domicilio.Calle, - ' .NumeroExterior = ubica.Domicilio.NumeroExterior, - ' .NumeroInterior = ubica.Domicilio.NumeroInterior, - ' .Colonia = ubica.Domicilio.Colonia, - ' .Localidad = ubica.Domicilio.Localidad, - ' .Referencia = ubica.Domicilio.Referencia, - ' .Municipio = ubica.Domicilio.Municipio, - ' .Estado = ubica.Domicilio.Estado, - ' .CodigoPostal = ubica.Domicilio.CP} - ''falta pais + ComCartaPorte.Ubicaciones(i).Domicilio = New ProfactCartaPorte.CartaPorteUbicacionDomicilio With {.Calle = ubica.Domicilio.Calle, + .NumeroExterior = ubica.Domicilio.NumeroExterior, + .NumeroInterior = ubica.Domicilio.NumeroInterior, + .Colonia = ubica.Domicilio.Colonia, + .Localidad = ubica.Domicilio.Localidad, + .Referencia = ubica.Domicilio.Referencia, + .Municipio = ubica.Domicilio.Municipio, + .Estado = ubica.Domicilio.Estado, + .CodigoPostal = ubica.Domicilio.CP, + .Pais = CType([Enum].Parse(GetType(ProfactCartaPorte.c_Pais), ubica.Domicilio.Pais), ProfactCartaPorte.c_Pais)} - - - 'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida) - 'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.Origen.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida) - 'cfdi.CartaPorteDomicilio(ubica.Origen.Domicilio.Calle, ubica.Origen.Domicilio.NumeroExterior, ubica.Origen.Domicilio.NumeroInterior, ubica.Origen.Domicilio.Colonia, ubica.Origen.Domicilio.Localidad, ubica.Origen.Domicilio.Referencia, ubica.Origen.Domicilio.Municipio, ubica.Origen.Domicilio.Estado, ubica.Origen.Domicilio.Pais, ubica.Origen.Domicilio.CP) - 'destino - 'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorrida) - 'cfdi.CartaPorteDestino(ubica.Destino.IDDestino, ubica.Destino.RFCDestinatario, ubica.Destino.NombreDestinatario, ubica.Destino.NumRegIdTrib, ubica.Destino.ResidenciaFiscal, ubica.Destino.NumEstacion, ubica.Destino.NombreEstacion, ubica.Destino.NavegacionTrafico, ubica.Destino.FechaHoraProgLlegada) - 'cfdi.CartaPorteDomicilio(ubica.Destino.Domicilio.Calle, ubica.Destino.Domicilio.NumeroExterior, ubica.Destino.Domicilio.NumeroInterior, ubica.Destino.Domicilio.Colonia, ubica.Destino.Domicilio.Localidad, ubica.Destino.Domicilio.Referencia, ubica.Destino.Domicilio.Municipio, ubica.Destino.Domicilio.Estado, ubica.Destino.Domicilio.Pais, ubica.Destino.Domicilio.CP) Next End If @@ -3877,16 +3950,10 @@ Public Class Timbrado If concep.BienesTransp <> "" Then ComCartaPorte.Mercancias.Mercancia(i).BienesTransp = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ClaveProdServCP), "Item" & concep.BienesTransp), ProfactCartaPorte.c_ClaveProdServCP) - ComCartaPorte.Mercancias.Mercancia(i).BienesTranspSpecified = True - End If - If concep.ClaveSTCC <> "" Then - ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCCSpecified = True - ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCC = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ClaveProdSTCC), "Item" & concep.ClaveSTCC), ProfactCartaPorte.c_ClaveProdSTCC) End If ComCartaPorte.Mercancias.Mercancia(i).Descripcion = concep.Descripción ComCartaPorte.Mercancias.Mercancia(i).Cantidad = concep.Cantidad - ComCartaPorte.Mercancias.Mercancia(i).ClaveUnidadSpecified = False ComCartaPorte.Mercancias.Mercancia(i).Unidad = concep.Unidad ComCartaPorte.Mercancias.Mercancia(i).Dimensiones = concep.Dimensiones If concep.ClaveMaterialPeligroso <> "" Then @@ -3898,48 +3965,108 @@ Public Class Timbrado End If - ComCartaPorte.Mercancias.Mercancia(i).DescripEmbalaje = concep.DescripEmbalaje ComCartaPorte.Mercancias.Mercancia(i).PesoEnKg = concep.PesoenKg ComCartaPorte.Mercancias.Mercancia(i).ValorMercanciaSpecified = False ComCartaPorte.Mercancias.Mercancia(i).MonedaSpecified = False ComCartaPorte.Mercancias.Mercancia(i).FraccionArancelariaSpecified = False ComCartaPorte.Mercancias.Mercancia(i).UUIDComercioExt = concep.UUIDComercioExt + + Dim j As Integer = 0 + ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta = New ProfactCartaPorte.CartaPorteMercanciasMercanciaCantidadTransporta(Carta.Mercancias.Mercancias.Count - 1) {} + For Each transp In concep.MercanciasCantidadTransporta + ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j) = New ProfactCartaPorte.CartaPorteMercanciasMercanciaCantidadTransporta + ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j).Cantidad = transp.Cantidad + ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j).IDOrigen = transp.IDOrigen + ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(j).IDDestino = transp.IDDestino + 'ComCartaPorte.Mercancias.Mercancia(i).CantidadTransporta(1).CvesTransporte = transp.CvesTransportes + Next + i += 1 Next End If End If + + + + + 'If Carta.FiguraTransporte IsNot Nothing Then + + ' If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then + + ' cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT) + + ' cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM) + + ' cfdi.CartaPorteSeguros(Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil, + ' Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente, + ' Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga, Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga, + ' Carta.FiguraTransporte.AutoTransporte.PrimaSeguro) + + ' If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then + ' For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques + ' cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa) + ' Next + + ' End If + ' End If + + ' If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then + ' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores + ' cfdi.CartaPorteTiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, "")) + ' If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador + ' cfdi.CartaPortePartesTransporte("PT01") + ' cfdi.CartaPortePartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP) + ' End If + ' Next + ' End If + + 'End If + ' If Carta.FiguraTransporte IsNot Nothing Then If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then - ComCartaPorte.FiguraTransporte = New ProfactCartaPorte.CartaPorteFiguraTransporte - ComCartaPorte.FiguraTransporte.CveTransporte = ProfactCartaPorte.c_CveTransporte.Item02 - ComCartaPorte.Mercancias.AutotransporteFederal = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederal + + 'ComCartaPorte.FiguraTransporte(1). = ProfactCartaPorte.c_CveTransporte.Item02 + ComCartaPorte.Mercancias.Autotransporte = New ProfactCartaPorte.CartaPorteMercanciasAutotransporte If Carta.FiguraTransporte.AutoTransporte.PermisoSCT <> "" Then - ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermisoSCT), ProfactCartaPorte.c_TipoPermiso) + ComCartaPorte.Mercancias.Autotransporte.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermisoSCT), ProfactCartaPorte.c_TipoPermiso) End If - ComCartaPorte.Mercancias.AutotransporteFederal.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT + ComCartaPorte.Mercancias.Autotransporte.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT 'pendiente RMF 'ComCartaPorte.Mercancias.AutotransporteFederal.NombreAseg = Carta.FiguraTransporte.AutoTransporte.NombreAseg 'ComCartaPorte.Mercancias.AutotransporteFederal.NumPolizaSeguro = Carta.FiguraTransporte.AutoTransporte.NumPolizaSeguro - Dim ConfigVehicular As New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalIdentificacionVehicular + Dim ConfigVehicular As New ProfactCartaPorte.CartaPorteMercanciasAutotransporteIdentificacionVehicular ConfigVehicular.ConfigVehicular = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ConfigAutotransporte), Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular), ProfactCartaPorte.c_ConfigAutotransporte) ConfigVehicular.AnioModeloVM = Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM ConfigVehicular.PlacaVM = Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM - ComCartaPorte.Mercancias.AutotransporteFederal.IdentificacionVehicular = ConfigVehicular + ComCartaPorte.Mercancias.Autotransporte.IdentificacionVehicular = ConfigVehicular + + Dim ConfigVehicularSeguros As New ProfactCartaPorte.CartaPorteMercanciasAutotransporteSeguros + ConfigVehicularSeguros.AseguraRespCivil = Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil + ConfigVehicularSeguros.PolizaRespCivil = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil + ConfigVehicularSeguros.AseguraMedAmbiente = Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente + ConfigVehicularSeguros.PolizaMedAmbiente = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente + ConfigVehicularSeguros.AseguraCarga = Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga + ConfigVehicularSeguros.PolizaCarga = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga + + If Carta.FiguraTransporte.AutoTransporte.PrimaSeguro > 0 Then + ConfigVehicularSeguros.PrimaSeguro = Carta.FiguraTransporte.AutoTransporte.PrimaSeguro + ConfigVehicularSeguros.PrimaSeguroSpecified = True + End If If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then Dim i As Integer = 0 - ComCartaPorte.Mercancias.AutotransporteFederal.Remolques = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalRemolque(Carta.FiguraTransporte.AutoTransporte.Remolques.Count - 1) {} + ComCartaPorte.Mercancias.Autotransporte.Remolques = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteRemolque(Carta.FiguraTransporte.AutoTransporte.Remolques.Count - 1) {} For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporte.Remolques - ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i) = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalRemolque - ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i).SubTipoRem = CType([Enum].Parse(GetType(ProfactCartaPorte.c_SubTipoRem), concep.SubTipoRemolque), ProfactCartaPorte.c_SubTipoRem) - ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i).Placa = concep.Placa + ComCartaPorte.Mercancias.Autotransporte.Remolques(i) = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteRemolque + ComCartaPorte.Mercancias.Autotransporte.Remolques(i).SubTipoRem = CType([Enum].Parse(GetType(ProfactCartaPorte.c_SubTipoRem), concep.SubTipoRemolque), ProfactCartaPorte.c_SubTipoRem) + ComCartaPorte.Mercancias.Autotransporte.Remolques(i).Placa = concep.Placa i += 1 Next ' @@ -3948,25 +4075,25 @@ Public Class Timbrado If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then Dim i As Integer = 0 - ComCartaPorte.FiguraTransporte.Operadores = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador(Carta.FiguraTransporte.Operadores.Count - 1) {} + ComCartaPorte.FiguraTransporte = New ProfactCartaPorte.CartaPorteTiposFigura(Carta.FiguraTransporte.Operadores.Count - 1) {} For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores - ComCartaPorte.FiguraTransporte.Operadores(i) = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador - ComCartaPorte.FiguraTransporte.Operadores(i).RFCOperador = concep.RFCFigura - ComCartaPorte.FiguraTransporte.Operadores(i).NumLicencia = concep.NumLicencia - ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreFigura - ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribFigura + + ComCartaPorte.FiguraTransporte(i) = New ProfactCartaPorte.CartaPorteTiposFigura + ComCartaPorte.FiguraTransporte(i).RFCFigura = concep.RFCFigura + ComCartaPorte.FiguraTransporte(i).NumLicencia = concep.NumLicencia + ComCartaPorte.FiguraTransporte(i).NombreFigura = concep.NombreFigura + ComCartaPorte.FiguraTransporte(i).NumRegIdTribFigura = concep.NumRegidTribFigura 'OComCartaPorte.FiguraTransporte.Operadores(i)(0) = concep.ResidenciaFiscalOperador 'falta - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperadorDomicilio() - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Calle = concep.Domicilio.Calle - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.CodigoPostal = "25350" 'concep.Domicilio.CP - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Colonia = "0347" - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Estado = "COA" - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Localidad = "23" - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Municipio = "004" - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.NumeroExterior = "728" - ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Pais = ProfactCartaPorte.c_Pais.MEX - + ComCartaPorte.FiguraTransporte(i).Domicilio = New ProfactCartaPorte.CartaPorteTiposFiguraDomicilio() + ComCartaPorte.FiguraTransporte(i).Domicilio.Calle = concep.Domicilio.Calle + ComCartaPorte.FiguraTransporte(i).Domicilio.CodigoPostal = concep.Domicilio.CP + ComCartaPorte.FiguraTransporte(i).Domicilio.Colonia = concep.Domicilio.Colonia + ComCartaPorte.FiguraTransporte(i).Domicilio.Estado = concep.Domicilio.Estado + ComCartaPorte.FiguraTransporte(i).Domicilio.Localidad = concep.Domicilio.Localidad + ComCartaPorte.FiguraTransporte(i).Domicilio.Municipio = concep.Domicilio.Municipio + ComCartaPorte.FiguraTransporte(i).Domicilio.NumeroExterior = concep.Domicilio.NumeroExterior + ComCartaPorte.FiguraTransporte(i).Domicilio.Pais = ProfactCartaPorte.c_Pais.MEX i += 1 Next diff --git a/App_WebReferences/Cancelacion2022/Cancelacion.disco b/App_WebReferences/Cancelacion2022/Cancelacion.disco new file mode 100644 index 000000000..4ddc38db6 --- /dev/null +++ b/App_WebReferences/Cancelacion2022/Cancelacion.disco @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App_WebReferences/Cancelacion2022/Cancelacion.wsdl b/App_WebReferences/Cancelacion2022/Cancelacion.wsdl new file mode 100644 index 000000000..b11d5443c --- /dev/null +++ b/App_WebReferences/Cancelacion2022/Cancelacion.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_WebReferences/Cancelacion2022/Reference.svcmap b/App_WebReferences/Cancelacion2022/Reference.svcmap new file mode 100644 index 000000000..c8a95a14c --- /dev/null +++ b/App_WebReferences/Cancelacion2022/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_WebReferences/Cancelacion2022/configuration.svcinfo b/App_WebReferences/Cancelacion2022/configuration.svcinfo new file mode 100644 index 000000000..513fc18cd --- /dev/null +++ b/App_WebReferences/Cancelacion2022/configuration.svcinfo @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/App_WebReferences/Cancelacion2022/configuration91.svcinfo b/App_WebReferences/Cancelacion2022/configuration91.svcinfo new file mode 100644 index 000000000..b03c6a068 --- /dev/null +++ b/App_WebReferences/Cancelacion2022/configuration91.svcinfo @@ -0,0 +1,310 @@ + + + + + + + CancelacionSoap4 + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + CancelacionSoap5 + + + + + + + + + + + + + + + + + + + + + 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 + + + CancelacionSoap4 + + + Cancelacion2022.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 + + + CancelacionSoap2 + + + + + + + + + + + \ 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 0a09a646e..b80072e76 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1285,15 +1285,15 @@ Partial Class Bancos_IE End If - RecargaGlobalCuentasBancarias() - ObjIE.Dispose() - ObjIE2.Dispose() - UPPP.Update() - End Sub - Private Sub CargaGvRH() - GvRH.DataSource = DtGvRH - GvRH.DataBind() - UpGvRH.Update() + RecargaGlobalCuentasBancarias() + ObjIE.Dispose() + ObjIE2.Dispose() + UPPP.Update() + End Sub + Private Sub CargaGvRH() + GvRH.DataSource = DtGvRH + GvRH.DataBind() + UpGvRH.Update() End Sub Private Sub CargaCorteCaja(CveCuenta As Integer) 'Checar si hay un Turno Abierto @@ -1307,93 +1307,93 @@ Partial Class Bancos_IE ObjPVenta.Dispose() End Sub -#Region " CARGA PROVEEDOR " - Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs) - HdnCveProveedor.Value = DdlProveedores.SelectedValue - HdnCvePersonal.Value = "-1" - ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero - ViewState("CvePersonal") = "-1" - ViewState("CveCliente") = "-1" - - CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1") - End Sub - - Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String) - Dim ObjProveedor As New ClsCompProveedores() - - If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - If ObjProveedor.DtResultados.Rows.Count > 0 Then - TxtNotificarA.Text = ObjProveedor.NotificarA.Trim - TxtParaMail.Text = ObjProveedor.CorreoCobranza - TxtCC.Text = ObjProveedor.NotificarA.Trim - RazonSocial = ObjProveedor.DtResultados(0)("RazonSocial").ToString - HdnProvPorIVA.Value = ObjProveedor.IVA.ToString - HdnProvPorRetIVA.Value = ObjProveedor.RetIVA.ToString - HdnProvPorRetISR.Value = ObjProveedor.RetISR.ToString - Dim EsDevolucion As Boolean = False - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinC" Then - CveIE = -1 - EsDevolucion = True - RBL.SelectedValue = "P" - RBL.Enabled = False - DdlProveedores.Visible = True - DdlProveedores.Enabled = True - - IDCtaBeneficiarioComplementaria = ObjProveedor.IdCtaContProveedoresComplementaria - - DdlProveedores.SelectedText = ObjProveedor.NombreComercial - DdlProveedores.SelectedValue = ObjProveedor.CveProveedor.ToString +#Region " CARGA PROVEEDOR " + Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs) + HdnCveProveedor.Value = DdlProveedores.SelectedValue + HdnCvePersonal.Value = "-1" + ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero + ViewState("CvePersonal") = "-1" + ViewState("CveCliente") = "-1" + + CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1") + End Sub + + Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String) + Dim ObjProveedor As New ClsCompProveedores() + + If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + If ObjProveedor.DtResultados.Rows.Count > 0 Then + TxtNotificarA.Text = ObjProveedor.NotificarA.Trim + TxtParaMail.Text = ObjProveedor.CorreoCobranza + TxtCC.Text = ObjProveedor.NotificarA.Trim + RazonSocial = ObjProveedor.DtResultados(0)("RazonSocial").ToString + HdnProvPorIVA.Value = ObjProveedor.IVA.ToString + HdnProvPorRetIVA.Value = ObjProveedor.RetIVA.ToString + HdnProvPorRetISR.Value = ObjProveedor.RetISR.ToString + Dim EsDevolucion As Boolean = False + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinC" Then + CveIE = -1 + EsDevolucion = True + RBL.SelectedValue = "P" + RBL.Enabled = False + DdlProveedores.Visible = True + DdlProveedores.Enabled = True + + IDCtaBeneficiarioComplementaria = ObjProveedor.IdCtaContProveedoresComplementaria + + DdlProveedores.SelectedText = ObjProveedor.NombreComercial + DdlProveedores.SelectedValue = ObjProveedor.CveProveedor.ToString DivOtrosIngresosEgresos.Visible = True - End If - - Select Case RBL.SelectedValue - Case "P" + End If + + Select Case RBL.SelectedValue + Case "P" IDCtaBeneficiario = ObjProveedor.IdCtaContAnticipos - IdCtaAnticipoExtranjera = ObjProveedor.IdCtaContAnticiposExtranjera : IdCtaAnticipoComplementaria = ObjProveedor.IdCtaContAnticiposComplementaria - If EsDevolucion Then + IdCtaAnticipoExtranjera = ObjProveedor.IdCtaContAnticiposExtranjera : IdCtaAnticipoComplementaria = ObjProveedor.IdCtaContAnticiposComplementaria + If EsDevolucion Then IDCtaBeneficiario = ObjProveedor.IdCtaContProveedores - End If + End If Case "DD" : IDCtaBeneficiario = ObjProveedor.IdCtaContDeudor Case "AC" : IDCtaBeneficiario = ObjProveedor.IdCtaContAcreedor Case "DP" : IDCtaBeneficiario = ObjProveedor.IdCtaContDocsXPagar - Case Else - IDCtaBeneficiario = ObjProveedor.IdCtaContProveedores - End Select - - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then - - IDCtaBeneficiario = ObjProveedor.IdCtaContAcreedor - - If Not IDCtaBeneficiario > 0 Then - Alert("No se pudo cargar IDCtaBeneficiario", TipoMensaje.MsgAdvertencia) - End If - - End If - - - If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - BtnGuardar.Enabled = False - Else - BtnGuardar.Enabled = True - End If - UpGuardar.Update() - End If - - CargaCuentasDepositos() - Else - Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) - End If - End If - ObjProveedor.Dispose() + Case Else + IDCtaBeneficiario = ObjProveedor.IdCtaContProveedores + End Select + + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then + + IDCtaBeneficiario = ObjProveedor.IdCtaContAcreedor + + If Not IDCtaBeneficiario > 0 Then + Alert("No se pudo cargar IDCtaBeneficiario", TipoMensaje.MsgAdvertencia) + End If + + End If + + + If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + BtnGuardar.Enabled = False + Else + BtnGuardar.Enabled = True + End If + UpGuardar.Update() + End If + + CargaCuentasDepositos() + Else + Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) + End If + End If + ObjProveedor.Dispose() End Sub -#End Region +#End Region @@ -1467,136 +1467,136 @@ Partial Class Bancos_IE -#Region " CARGA CLIENTE " - Protected Sub DdlCliente_selectedindexchange(sender As Object, e As EventArgs) - HdnCveCliente.Value = DdlCliente.SelectedValue - HdnCveProveedor.Value = "-1" - ViewState("CveCliente") = HdnCveCliente.Value.ToEntero - ViewState("CveProveedor") = -1 - ViewState("CvePersonal") = -1 - CargaCliente(HdnCveCliente.Value.ToEntero) - End Sub - - Private Sub CargaCliente(ByVal CveCliente As Integer) - Dim ObjCliente As New ClsClientes - - If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - If ObjCliente.DtResultados.Rows.Count > 0 Then - - HdnProvPorIVA.Value = "0" 'ObjProveedor.IVA.ToString - HdnProvPorRetIVA.Value = "0" 'ObjProveedor.RetIVA.ToString - HdnProvPorRetISR.Value = "0" 'ObjProveedor.RetISR.ToString - IDCtaBeneficiario = ObjCliente.IdCtaContAnticipos - IDCtaBeneficiarioComplementaria = ObjCliente.IdCtaContCompAnticipos - CorreoCobranzaCliente = ObjCliente.CobranzaCorreo - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinV" Then - IDCtaBeneficiario = ObjCliente.IdCtaContClientes - IDCtaBeneficiarioComplementaria = ObjCliente.IdCtaContCompClientes - DdlCliente.SelectedText = ObjCliente.NombreComercial - DdlCliente.SelectedValue = ObjCliente.CveCliente.ToString - DivOtrosIngresosEgresos.Visible = True - End If - - If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) +#Region " CARGA CLIENTE " + Protected Sub DdlCliente_selectedindexchange(sender As Object, e As EventArgs) + HdnCveCliente.Value = DdlCliente.SelectedValue + HdnCveProveedor.Value = "-1" + ViewState("CveCliente") = HdnCveCliente.Value.ToEntero + ViewState("CveProveedor") = -1 + ViewState("CvePersonal") = -1 + CargaCliente(HdnCveCliente.Value.ToEntero) + End Sub + + Private Sub CargaCliente(ByVal CveCliente As Integer) + Dim ObjCliente As New ClsClientes + + If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + If ObjCliente.DtResultados.Rows.Count > 0 Then + + HdnProvPorIVA.Value = "0" 'ObjProveedor.IVA.ToString + HdnProvPorRetIVA.Value = "0" 'ObjProveedor.RetIVA.ToString + HdnProvPorRetISR.Value = "0" 'ObjProveedor.RetISR.ToString + IDCtaBeneficiario = ObjCliente.IdCtaContAnticipos + IDCtaBeneficiarioComplementaria = ObjCliente.IdCtaContCompAnticipos + CorreoCobranzaCliente = ObjCliente.CobranzaCorreo + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinV" Then + IDCtaBeneficiario = ObjCliente.IdCtaContClientes + IDCtaBeneficiarioComplementaria = ObjCliente.IdCtaContCompClientes + DdlCliente.SelectedText = ObjCliente.NombreComercial + DdlCliente.SelectedValue = ObjCliente.CveCliente.ToString + DivOtrosIngresosEgresos.Visible = True + End If + + If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False - Else - BtnGuardar.Enabled = True - End If - UpGuardar.Update() - End If - - CargaCuentasDepositos() - - Else - Alert("El Cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) - End If - End If - ObjCliente.Dispose() - End Sub -#End Region + Else + BtnGuardar.Enabled = True + End If + UpGuardar.Update() + End If -#Region " CARGA PERSONAL " - Protected Sub CargaDDLPersonal() - Dim ObjPersonal As New ClsRH - If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then - If ObjPersonal.DtResultados.Rows.Count > 0 Then - DdlPersonal.DataSource = ObjPersonal.DtResultados - DdlPersonal.DataBind() - DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) - End If - End If - ObjPersonal.Dispose() - End Sub - - Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) - HdnCveProveedor.Value = "-1" - HdnCvePersonal.Value = DdlPersonal.SelectedValue - - ViewState("CveProveedor") = "-1" - ViewState("CvePersonal") = HdnCvePersonal.Value - ViewState("CveCliente") = "-1" - - PersonalIndexChange(HdnCvePersonal.Value.ToEntero) - End Sub - - Private Sub PersonalIndexChange(ByVal CvePersonal As Integer) - Dim ObjPersonal As New ClsRH - - If ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then - If ObjPersonal.DtResultados.Rows.Count > 0 Then - DdlPersonal.SelectedValue = CvePersonal.ToString - - HdnProvPorIVA.Value = "0" 'ObjProveedor.IVA.ToString - HdnProvPorRetIVA.Value = "0" 'ObjProveedor.RetIVA.ToString - HdnProvPorRetISR.Value = "0" 'ObjProveedor.RetISR.ToString - IDCtaBeneficiario = ObjPersonal.IdCtaContPersonal - - If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then - If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - BtnGuardar.Enabled = False - Else - BtnGuardar.Enabled = True - End If - UpGuardar.Update() - End If - - CargaCuentasDepositos() - Else - Alert("El Personal solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) - End If - End If - ObjPersonal.Dispose() + CargaCuentasDepositos() + + Else + Alert("El Cliente solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) + End If + End If + ObjCliente.Dispose() End Sub -#End Region +#End Region + +#Region " CARGA PERSONAL " + Protected Sub CargaDDLPersonal() + Dim ObjPersonal As New ClsRH + If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then + If ObjPersonal.DtResultados.Rows.Count > 0 Then + DdlPersonal.DataSource = ObjPersonal.DtResultados + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) + End If + End If + ObjPersonal.Dispose() + End Sub + + Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) + HdnCveProveedor.Value = "-1" + HdnCvePersonal.Value = DdlPersonal.SelectedValue + + ViewState("CveProveedor") = "-1" + ViewState("CvePersonal") = HdnCvePersonal.Value + ViewState("CveCliente") = "-1" + + PersonalIndexChange(HdnCvePersonal.Value.ToEntero) + End Sub + + Private Sub PersonalIndexChange(ByVal CvePersonal As Integer) + Dim ObjPersonal As New ClsRH + + If ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then + If ObjPersonal.DtResultados.Rows.Count > 0 Then + DdlPersonal.SelectedValue = CvePersonal.ToString + + HdnProvPorIVA.Value = "0" 'ObjProveedor.IVA.ToString + HdnProvPorRetIVA.Value = "0" 'ObjProveedor.RetIVA.ToString + HdnProvPorRetISR.Value = "0" 'ObjProveedor.RetISR.ToString + IDCtaBeneficiario = ObjPersonal.IdCtaContPersonal + + If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then + If IDCtaBeneficiario = 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + Alert("El Beneficiario no tiene cuenta contable vinculada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + BtnGuardar.Enabled = False + Else + BtnGuardar.Enabled = True + End If + UpGuardar.Update() + End If + + CargaCuentasDepositos() + Else + Alert("El Personal solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) + End If + End If + ObjPersonal.Dispose() + End Sub +#End Region + +#Region " CARGA CUENTAS DEPOSITOS " + Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged + Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero + Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing + + If dr IsNot Nothing Then + HdnTipoTransaccion.Value = dr("Tipo").ToString + End If + + Select Case valor + Case 1 + LblPagueseA.Text = "Páguese a" + Case 2 + LblPagueseA.Text = "Beneficiario" + End Select + + 'RecargaCuentas + CargaCuenta(CveMoneda) + RecargaCuentasDepositos() + + UpDatos.Update() + BtnGuardar.Enabled = True + End Sub -#Region " CARGA CUENTAS DEPOSITOS " - Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged - Dim valor As Integer = DirectCast(sender, DropDownList).SelectedValue.ToEntero - Dim dr As DataRow = GlobalDTTipoTransacciones.FiltroPrimero(String.Format("CveTipoTransaccion = {0}", DdlTipoTransaccion.SelectedValue)) 'Egs o Ing - - If dr IsNot Nothing Then - HdnTipoTransaccion.Value = dr("Tipo").ToString - End If - - Select Case valor - Case 1 - LblPagueseA.Text = "Páguese a" - Case 2 - LblPagueseA.Text = "Beneficiario" - End Select - - 'RecargaCuentas - CargaCuenta(CveMoneda) - RecargaCuentasDepositos() - - UpDatos.Update() - BtnGuardar.Enabled = True - End Sub - Protected Sub DdlCuenta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuenta.SelectedIndexChanged 'si solo es de egreso el movimiento debe de generar el siguiente folio. @@ -1605,14 +1605,14 @@ Partial Class Bancos_IE If (Not ExistenComplementosVigentes) And UsuarioActual.TienePermisoProceso(99) And BtnActualizar.Visible = True Then ActualizaCuenta = True - End If - - If HdnTipoTransaccion.Value = "Egs" AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Or Opcion = "DevDinC" Or ActualizaCuenta Then - - Dim Folio As Long - Dim Banco As New ClsBancos - Folio = Banco.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero) - Banco.Dispose() + End If + + If HdnTipoTransaccion.Value = "Egs" AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Or Opcion = "DevDinC" Or ActualizaCuenta Then + + Dim Folio As Long + Dim Banco As New ClsBancos + Folio = Banco.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero) + Banco.Dispose() TxtFolio.Text = Folio.ToString Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) @@ -1624,392 +1624,392 @@ Partial Class Bancos_IE End If - Else - TxtFolio.Text = "" - End If - - Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) - If dr IsNot Nothing Then - - - DdlMoneda.SelectedValue = dr("CveMoneda").ToString - IDCtaContable = dr("IdCtaContable").ToString.ToEntero + Else + TxtFolio.Text = "" + End If + + Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) + If dr IsNot Nothing Then + + + DdlMoneda.SelectedValue = dr("CveMoneda").ToString + IDCtaContable = dr("IdCtaContable").ToString.ToEntero IDCtaContableComplementaria = dr("IDCtaContableComplementaria").ToString.ToEntero - CambiaTipoMoneda() - - If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") Then - If dr("CveTipoCuenta").ToString.ToEntero = 1 Then - Dim ObjMovtos As New ClsMovimientos - If DdlCuenta.SelectedValue.ToEntero > 0 Then - ObjMovtos.GetCajaChicaDetalle(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) - - If ObjMovtos.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha").Rows.Count > 0 Then - DDlCheques.DataSource = ObjMovtos.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha") - DDlCheques.DataBind() - DDlCheques.Items.Insert(0, New ListItem("-", "-1")) - DivCheques.Visible = True - End If - End If - ObjMovtos.Dispose() - Else - DivCheques.Visible = False - End If - + CambiaTipoMoneda() + + If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") Then + If dr("CveTipoCuenta").ToString.ToEntero = 1 Then + Dim ObjMovtos As New ClsMovimientos + If DdlCuenta.SelectedValue.ToEntero > 0 Then + ObjMovtos.GetCajaChicaDetalle(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) + + If ObjMovtos.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha").Rows.Count > 0 Then + DDlCheques.DataSource = ObjMovtos.DtResultados.FiltraParametros("CveIE > 0", "FechaDocumento, FolioFecha") + DDlCheques.DataBind() + DDlCheques.Items.Insert(0, New ListItem("-", "-1")) + DivCheques.Visible = True + End If + End If + ObjMovtos.Dispose() + Else + DivCheques.Visible = False + End If + End If 'PAGAR NC CON C.CH DEBE DESCONTAR EN EL CORTE If Opcion IsNot Nothing AndAlso Opcion = "DevDinV" AndAlso dr("CveTipoCuenta").ToString.ToEntero = 1 Then CargaCorteCaja(DdlCuenta.SelectedValue.ToEntero) - End If - - If dr("UsaTarjeta").ToString = "True" Then - CargaGridTarjetas() - Else - DivTarjeta.Visible = False - End If - - If Not IDCtaContable > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then - Alert("La Cuenta Bancaria no tiene asignada una cuenta contable", TipoMensaje.MsgAdvertencia) - End If - - End If - - If trIEDevolucion.Visible And RBL.SelectedValue <> "C" Then - CargaIEDevoluciones() - End If + End If + + If dr("UsaTarjeta").ToString = "True" Then + CargaGridTarjetas() + Else + DivTarjeta.Visible = False + End If + + If Not IDCtaContable > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then + Alert("La Cuenta Bancaria no tiene asignada una cuenta contable", TipoMensaje.MsgAdvertencia) + End If + + End If + + If trIEDevolucion.Visible And RBL.SelectedValue <> "C" Then + CargaIEDevoluciones() + End If End Sub -#End Region +#End Region + +#Region " CARGA CREDITOS - DETALLE " + Protected Sub DdlFinanciera_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFinanciera.SelectedIndexChanged + CargaCreditos(DdlFinanciera.SelectedValue.ToEntero) -#Region " CARGA CREDITOS - DETALLE " - Protected Sub DdlFinanciera_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFinanciera.SelectedIndexChanged - CargaCreditos(DdlFinanciera.SelectedValue.ToEntero) - - End Sub - - Private Sub CargaCreditos(CveProveedor As Integer) - If CveProveedor < 1 Then Exit Sub - - Dim Cred As New ClsBancos - Dim dt As DataTable = Nothing - - If Cred.GetCreditos(-1, -1, -1, CveProveedor, -1, UsuarioActual.CveEmpresa) Then - CveProveedor = Cred.CveProveedor - DdlCredito.DataSource = Cred.DtResultados.FiltraParametros(String.Format("CveProveedor = {0} AND EstatusNum in (1,2,101,102)", DdlFinanciera.SelectedValue), DistinctColumns:={"CveCredito", "ReferenciaCredito"}, Orderby:="ReferenciaCredito") - DdlCredito.DataBind() - DdlCredito.Items.Insert(0, New ListItem("Seleccione", "-1")) - - - End If - - Cred.Dispose() - - DdlCreditoDetalle.Items.Clear() - DdlCreditoDetalle.DataSource = Nothing - DdlCreditoDetalle.DataBind() - - - - End Sub - - Protected Sub DdlCredito_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCredito.SelectedIndexChanged - CargaCreditosDetalle() - End Sub - - Protected Sub DdlCreditoDetalle_SelectedIndexChanged(sender As Object, e As EventArgs) - CargaCreditosDetalle(DdlCreditoDetalle.SelectedValue.ToEntero) - End Sub - - Private Sub CargaCreditosDetalle(Optional CveCreditoDetalle As Integer = -1) - Dim Cred As New ClsBancos - Dim dt As DataTable = Nothing - Dim dt2 As DataTable = Nothing - - If DdlCredito.SelectedValue.ToEntero > 0 AndAlso Cred.GetCreditos(DdlCredito.SelectedValue.ToEntero, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then - CveProveedor = Cred.CveProveedor - HdnCveTipoCredito.Value = Cred.CveTipoCredito.ToString - - If Cred.GetCreditosDetalle(DdlCredito.SelectedValue.ToEntero, -1) Then - dt = Cred.DtResultados.FiltraParametros("Estatus IN (1,101,102)") - - Dim Importe As Decimal = 0 - If CveCreditoDetalle > 0 Then - Dim drt As DataRow = Cred.DtResultados.FiltroPrimero(String.Format("CveCreditoDetalle = {0}", CveCreditoDetalle)) - If drt IsNot Nothing Then - 'verifico si es credito está activo - If Not drt("Estatus").ToString.Contiene("1", "101", "102") Then - Alert("La Mensualidad no está vigente para pago", TipoMensaje.MsgError) - End If - Importe = dt.FiltroPrimeroValor("Mensualidad", String.Format("CveCreditoDetalle = {0}", CveCreditoDetalle)).ToDecimal - End If - - - End If - - - TxtImporte.Text = Importe.ToString - HdnImporteCredito.Value = Importe.ToString - RegistraScript(String.Format("$get('TxtImporte').value = '{0}';", Importe.FormatoNumero)) - TxtImporte.Attributes.Remove("onkeyup") - TxtImporte.Attributes.Add("onkeyup", String.Format("ValidaCantidad({0},{1});", TxtImporte.ClientID, Importe)) - - End If - - End If - - Cred.Dispose() - - DdlCreditoDetalle.Items.Clear() - - If dt IsNot Nothing Then - DdlCreditoDetalle.DataSource = dt - End If - DdlCreditoDetalle.DataBind() - - If CveCreditoDetalle = -1 Then - DdlCreditoDetalle.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlCreditoDetalle.SelectedValue = "-1" - Else - DdlCreditoDetalle.SelectedValueExist(CveCreditoDetalle.ToString) - Try - TxtObservaciones.Text = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) - Catch ex As Exception - - End Try - - End If - - - UpDatos.Update() End Sub -#End Region -#End Region -#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" + Private Sub CargaCreditos(CveProveedor As Integer) + If CveProveedor < 1 Then Exit Sub + + Dim Cred As New ClsBancos + Dim dt As DataTable = Nothing + + If Cred.GetCreditos(-1, -1, -1, CveProveedor, -1, UsuarioActual.CveEmpresa) Then + CveProveedor = Cred.CveProveedor + DdlCredito.DataSource = Cred.DtResultados.FiltraParametros(String.Format("CveProveedor = {0} AND EstatusNum in (1,2,101,102)", DdlFinanciera.SelectedValue), DistinctColumns:={"CveCredito", "ReferenciaCredito"}, Orderby:="ReferenciaCredito") + DdlCredito.DataBind() + DdlCredito.Items.Insert(0, New ListItem("Seleccione", "-1")) + + + End If + + Cred.Dispose() + + DdlCreditoDetalle.Items.Clear() + DdlCreditoDetalle.DataSource = Nothing + DdlCreditoDetalle.DataBind() + + - Private Sub CargaCuenta(Optional pCveMoneda As Integer = -1) - DdlCuenta.Items.Clear() - Dim dt As DataTable - - If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) - Else - dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas - End If - - - If pCveMoneda > 0 Then - dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", pCveMoneda)) - End If - - 'cuando es layout - If DdlTipoTransaccion.SelectedValue.ToEntero = 9 Then - dt = dt.FiltraParametros("UsaLayout = 1") - End If - - DdlCuenta.DataSource = dt - DdlCuenta.DataBind() - DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub - - Private Sub CargaTipoTransaccion() - Dim dt As DataTable - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") - LtlTitulo.Text = "Egreso Por Comprobar" - - RBL.Items.Remove(RBL.Items.FindByValue("C")) - ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") - LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") - LblPagueseA.Text = "Recibido de:" - RBL.SelectedValue = "C" - Anexo.Visible = True - ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") - LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") - LblPagueseA.Text = "Recibido de:" - RBL.SelectedValue = "C" - Anexo.Visible = True - - RBL.Items.Remove(RBL.Items.FindByValue("P")) - RBL.Items.Remove(RBL.Items.FindByValue("FE")) - - ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") - LtlTitulo.Text = "Anticipo de Cliente" - LblPagueseA.Text = "Recibido de:" - Anexo.Visible = True - RBL.Items.Remove(RBL.Items.FindByValue("P")) : RBL.Items.Remove(RBL.Items.FindByValue("FE")) : RBL.Items.Remove(RBL.Items.FindByValue("DD")) : RBL.Items.Remove(RBL.Items.FindByValue("AC")) : RBL.Items.Remove(RBL.Items.FindByValue("DP")) - ElseIf Opcion = "DevDinV" Then ' DEVOLUCION DINERO NC-VENTAS - dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") - LtlTitulo.Text = "Devolución dinero" - RBL.SelectedValue = "C" - RBL.Enabled = False - Else - dt = GlobalDTTipoTransacciones - End If - - - - If Opcion = "DevDinC" AndAlso Request("P") IsNot Nothing AndAlso Request("P").Length > 0 Or Opcion = "DevDinC" AndAlso Masivonotas Then - DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' ") - Else - DdlTipoTransaccion.DataSource = dt - End If - - - DdlTipoTransaccion.DataBind() - DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) - RBL_SelectedIndexChanged(RBL, Nothing) - - End Sub - - Private Sub CargaMoneda() - DdlMoneda.DataSource = GlobalDTMonedas - DdlMoneda.DataBind() End Sub -#End Region -#Region "VIATICOS" + Protected Sub DdlCredito_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCredito.SelectedIndexChanged + CargaCreditosDetalle() + End Sub - Private Function TimbrarNomina12(CvePersonal As Integer) As String - - Dim Retorno As String = "" - UsuarioActual.Empresa.CvePAC = 2 - Dim sw As New Diagnostics.Stopwatch - sw.Start() - Select Case UsuarioActual.Empresa.CvePAC - Case 1 - 'Retorno = TimbrarBIInformNomina12(CveNomina, CvePersonal, CvePeriodo) - Case 2, 4 - Dim cfdi As CFDITimbre = PreTimbrar(CvePersonal) - If cfdi Is Nothing Then - sw.Stop() - Return "No tiene asignado un folio de viaticos" - End If - If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then - Dim ObjTimbrado As New Timbrado - Dim ObjFactura As New Modelos.Factura - ObjFactura.TipoDocto = "Viaticos" - ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero - ObjFactura.Serie = cfdi.Comprobante.Serie - ObjFactura.Timbre = cfdi - If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then - Retorno = ObjTimbrado.MensajeErrorCFDI - End If - - 'Retorno = TimbrarFacturaRealVirtual(cfdi, UsuarioActual) - If Retorno <> "" Then - Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}" - Else - 'Genero la addenda Ford - ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo) - End If - Else - Retorno = $"No se pudo generar el pretimbre:
{cfdi.Mensaje}" - End If - End Select - sw.Stop() - GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC, "Nomina") - - Return Retorno - - End Function - - - - - Private Function PreTimbrar(CvePersonal As Integer) As CFDITimbre - Dim cfdi As New CFDITimbre - Dim ObjFolio As New ClsGralFolios - If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then - If ObjFolio.DtResultados.Rows.Count > 0 Then - Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString - Else - ObjFolio.Dispose() - Return Nothing - End If - End If - ObjFolio.Dispose() - - Dim objPersonal As New ClsRH - objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) - - Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero - - cfdi.Nomina = New CFDINomina - cfdi.Nomina.Version = "1.2" - cfdi.Nomina.TipoNomina = "E" - cfdi.Nomina.FechaPago = TxtFechaDocumento.Text.ToDate - cfdi.Nomina.FechaInicio = TxtFechaDocumento.Text - cfdi.Nomina.FechaFin = TxtFechaDocumento.Text - cfdi.Nomina.NumDiasPagados = 1 - cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa - cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC - cfdi.Emisor.RegistroPatronal = UsuarioActual.Empresa.RegistroPatronal - cfdi.Emisor.RegimenFiscal = UsuarioActual.Empresa.CodigoRegimenFiscal - - 'aplica persona fisica debe de tener CURP - If cfdi.Emisor.RegimenFiscal.Contiene("605", "606", "608", "611", "612", "614", "616", "621", "622", "629", "630", "615") Then - cfdi.Emisor.CURP = UsuarioActual.Empresa.CURP - End If - - - cfdi.Receptor.UsoCFDI = "P01" - cfdi.Receptor.RFC = objPersonal.RFC - cfdi.Receptor.Nombre = objPersonal.NombreCompleto - - Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos) - ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003", - .Clave = "003", - .Concepto = "Viáticos (entregados al trabajador).", - .Importe = TxtImporte.Text.ToString.ToDecimal - } - ) - If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos - - cfdi.Comprobante.Version = "3.3" - cfdi.Comprobante.Serie = "VIA" - cfdi.Comprobante.Folio = Folio - cfdi.Comprobante.Fecha = Now - cfdi.Comprobante.Subtotal = TxtImporte.Text.ToDecimal - cfdi.Comprobante.Descuentos = 0 - cfdi.Comprobante.Total = TxtImporte.Text.ToDecimal - cfdi.Comprobante.MotivoDescuento = "" - cfdi.Comprobante.Moneda = "MXN" - cfdi.Comprobante.TipoComprobante = "N" - cfdi.Comprobante.TipoDocto = "Egs" - cfdi.Comprobante.MetodoPago = "PUE" - cfdi.Comprobante.CondicionesdePago = "" - cfdi.Comprobante.FormadePago = "99" - cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString - cfdi.Comprobante.NumCuentaPago = "" - - - cfdi.Nomina.Receptor.CURP = objPersonal.CURP - cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS - cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToShortDateString - cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W" - cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato - cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada - cfdi.Nomina.Receptor.CodigoRegimenContratacion = If(objPersonal.CveRegimenContratacion = "", "99", objPersonal.CveRegimenContratacion) - cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo - cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento - cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto - cfdi.Nomina.Receptor.CodigoRiesgoPuesto = If(objPersonal.CveSATRiesgoPuesto.ToString = "0", "99", objPersonal.CveSATRiesgoPuesto.ToString) - cfdi.Nomina.Receptor.TipoPeriodo = objPersonal.TipoPeriodoPago - cfdi.Nomina.Receptor.CodigoBanco = objPersonal.ClaveBanco - cfdi.Nomina.Receptor.NumeroCuenta = objPersonal.BancoNumCuenta - cfdi.Nomina.Receptor.SDI = objPersonal.SDI - cfdi.Nomina.Receptor.SBC = objPersonal.SDI - cfdi.Nomina.Receptor.Sindicalizado = "" - cfdi.Nomina.Receptor.CodigoEntidadFederativa = objPersonal.ClaveEstado - - - cfdi.Conceptos.Add(New CFDIConceptos With {.Cantidad = 1, .ClaveUnidad = "ACT", .ClaveProdServ = "84111505", .Descripcion = "Pago de nómina", .ValorUnitario = cfdi.Comprobante.Subtotal, .Importe = cfdi.Comprobante.Subtotal, .Descuento = cfdi.Nomina.TotalDeducciones.ToDecimal}) - - objPersonal.Dispose() - Return cfdi + Protected Sub DdlCreditoDetalle_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaCreditosDetalle(DdlCreditoDetalle.SelectedValue.ToEntero) + End Sub + + Private Sub CargaCreditosDetalle(Optional CveCreditoDetalle As Integer = -1) + Dim Cred As New ClsBancos + Dim dt As DataTable = Nothing + Dim dt2 As DataTable = Nothing + + If DdlCredito.SelectedValue.ToEntero > 0 AndAlso Cred.GetCreditos(DdlCredito.SelectedValue.ToEntero, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then + CveProveedor = Cred.CveProveedor + HdnCveTipoCredito.Value = Cred.CveTipoCredito.ToString + + If Cred.GetCreditosDetalle(DdlCredito.SelectedValue.ToEntero, -1) Then + dt = Cred.DtResultados.FiltraParametros("Estatus IN (1,101,102)") + + Dim Importe As Decimal = 0 + If CveCreditoDetalle > 0 Then + Dim drt As DataRow = Cred.DtResultados.FiltroPrimero(String.Format("CveCreditoDetalle = {0}", CveCreditoDetalle)) + If drt IsNot Nothing Then + 'verifico si es credito está activo + If Not drt("Estatus").ToString.Contiene("1", "101", "102") Then + Alert("La Mensualidad no está vigente para pago", TipoMensaje.MsgError) + End If + Importe = dt.FiltroPrimeroValor("Mensualidad", String.Format("CveCreditoDetalle = {0}", CveCreditoDetalle)).ToDecimal + End If + + + End If + + + TxtImporte.Text = Importe.ToString + HdnImporteCredito.Value = Importe.ToString + RegistraScript(String.Format("$get('TxtImporte').value = '{0}';", Importe.FormatoNumero)) + TxtImporte.Attributes.Remove("onkeyup") + TxtImporte.Attributes.Add("onkeyup", String.Format("ValidaCantidad({0},{1});", TxtImporte.ClientID, Importe)) + + End If + + End If + + Cred.Dispose() + + DdlCreditoDetalle.Items.Clear() + + If dt IsNot Nothing Then + DdlCreditoDetalle.DataSource = dt + End If + DdlCreditoDetalle.DataBind() + + If CveCreditoDetalle = -1 Then + DdlCreditoDetalle.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlCreditoDetalle.SelectedValue = "-1" + Else + DdlCreditoDetalle.SelectedValueExist(CveCreditoDetalle.ToString) + Try + TxtObservaciones.Text = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) + Catch ex As Exception + + End Try + + End If + + + UpDatos.Update() + End Sub +#End Region +#End Region + +#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" + + Private Sub CargaCuenta(Optional pCveMoneda As Integer = -1) + DdlCuenta.Items.Clear() + Dim dt As DataTable + + If UsuarioActual.Empresa.Funcionalidad(127) = "1" Then + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) + Else + dt = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveTipoCuenta <> 1") ' quito las cajas chicas + End If + + + If pCveMoneda > 0 Then + dt = dt.FiltraParametros(String.Format("CveMoneda = {0}", pCveMoneda)) + End If + + 'cuando es layout + If DdlTipoTransaccion.SelectedValue.ToEntero = 9 Then + dt = dt.FiltraParametros("UsaLayout = 1") + End If + + DdlCuenta.DataSource = dt + DdlCuenta.DataBind() + DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1")) + End Sub + + Private Sub CargaTipoTransaccion() + Dim dt As DataTable + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") + LtlTitulo.Text = "Egreso Por Comprobar" + + RBL.Items.Remove(RBL.Items.FindByValue("C")) + ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") + LblPagueseA.Text = "Recibido de:" + RBL.SelectedValue = "C" + Anexo.Visible = True + ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución") + LblPagueseA.Text = "Recibido de:" + RBL.SelectedValue = "C" + Anexo.Visible = True + + RBL.Items.Remove(RBL.Items.FindByValue("P")) + RBL.Items.Remove(RBL.Items.FindByValue("FE")) + + ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'") + LtlTitulo.Text = "Anticipo de Cliente" + LblPagueseA.Text = "Recibido de:" + Anexo.Visible = True + RBL.Items.Remove(RBL.Items.FindByValue("P")) : RBL.Items.Remove(RBL.Items.FindByValue("FE")) : RBL.Items.Remove(RBL.Items.FindByValue("DD")) : RBL.Items.Remove(RBL.Items.FindByValue("AC")) : RBL.Items.Remove(RBL.Items.FindByValue("DP")) + ElseIf Opcion = "DevDinV" Then ' DEVOLUCION DINERO NC-VENTAS + dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'") + LtlTitulo.Text = "Devolución dinero" + RBL.SelectedValue = "C" + RBL.Enabled = False + Else + dt = GlobalDTTipoTransacciones + End If + + + + If Opcion = "DevDinC" AndAlso Request("P") IsNot Nothing AndAlso Request("P").Length > 0 Or Opcion = "DevDinC" AndAlso Masivonotas Then + DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' ") + Else + DdlTipoTransaccion.DataSource = dt + End If + + + DdlTipoTransaccion.DataBind() + DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1")) + RBL_SelectedIndexChanged(RBL, Nothing) + + End Sub + + Private Sub CargaMoneda() + DdlMoneda.DataSource = GlobalDTMonedas + DdlMoneda.DataBind() + End Sub +#End Region + +#Region "VIATICOS" + + Private Function TimbrarNomina12(CvePersonal As Integer) As String + + Dim Retorno As String = "" + UsuarioActual.Empresa.CvePAC = 2 + Dim sw As New Diagnostics.Stopwatch + sw.Start() + Select Case UsuarioActual.Empresa.CvePAC + Case 1 + 'Retorno = TimbrarBIInformNomina12(CveNomina, CvePersonal, CvePeriodo) + Case 2, 4 + Dim cfdi As CFDITimbre = PreTimbrar(CvePersonal) + If cfdi Is Nothing Then + sw.Stop() + Return "No tiene asignado un folio de viaticos" + End If + If cfdi IsNot Nothing AndAlso cfdi.Mensaje = "" Then + Dim ObjTimbrado As New Timbrado + Dim ObjFactura As New Modelos.Factura + ObjFactura.TipoDocto = "Viaticos" + ObjFactura.Folio = cfdi.Comprobante.Folio.ToEntero + ObjFactura.Serie = cfdi.Comprobante.Serie + ObjFactura.Timbre = cfdi + If Not ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then + Retorno = ObjTimbrado.MensajeErrorCFDI + End If + + 'Retorno = TimbrarFacturaRealVirtual(cfdi, UsuarioActual) + If Retorno <> "" Then + Retorno = $"{Retorno} - {cfdi.Receptor.Nombre}" + Else + 'Genero la addenda Ford + ' GeneraPDFNuevo(String.Format("{0}XML\Nomina\{1}.xml", Ruta, NominaFolio), CvePersonal, CvePeriodo) + End If + Else + Retorno = $"No se pudo generar el pretimbre:
{cfdi.Mensaje}" + End If + End Select + sw.Stop() + GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC, "Nomina") + + Return Retorno + + End Function + + + + + Private Function PreTimbrar(CvePersonal As Integer) As CFDITimbre + Dim cfdi As New CFDITimbre + Dim ObjFolio As New ClsGralFolios + If ObjFolio.GetFolios("VIA", UsuarioActual.CveEmpresa) Then + If ObjFolio.DtResultados.Rows.Count > 0 Then + Folio = ObjFolio.DtResultados.Rows(0)("FActual").ToString + Else + ObjFolio.Dispose() + Return Nothing + End If + End If + ObjFolio.Dispose() + + Dim objPersonal As New ClsRH + objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) + + Dim AntiguedadSemanas As Integer = DateDiff(DateInterval.Weekday, objPersonal.FechaIngreso, Now).ToEntero + + cfdi.Nomina = New CFDINomina + cfdi.Nomina.Version = "1.2" + cfdi.Nomina.TipoNomina = "E" + cfdi.Nomina.FechaPago = TxtFechaDocumento.Text.ToDate + cfdi.Nomina.FechaInicio = TxtFechaDocumento.Text + cfdi.Nomina.FechaFin = TxtFechaDocumento.Text + cfdi.Nomina.NumDiasPagados = 1 + cfdi.Emisor.Nombre = UsuarioActual.Empresa.Empresa + cfdi.Emisor.RFC = UsuarioActual.Empresa.RFC + cfdi.Emisor.RegistroPatronal = UsuarioActual.Empresa.RegistroPatronal + cfdi.Emisor.RegimenFiscal = UsuarioActual.Empresa.CodigoRegimenFiscal + + 'aplica persona fisica debe de tener CURP + If cfdi.Emisor.RegimenFiscal.Contiene("605", "606", "608", "611", "612", "614", "616", "621", "622", "629", "630", "615") Then + cfdi.Emisor.CURP = UsuarioActual.Empresa.CURP + End If + + + cfdi.Receptor.UsoCFDI = "P01" + cfdi.Receptor.RFC = objPersonal.RFC + cfdi.Receptor.Nombre = objPersonal.NombreCompleto + + Dim ObjOtrosPagos As New List(Of CFDINominaOtrosPagos) + ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003", + .Clave = "003", + .Concepto = "Viáticos (entregados al trabajador).", + .Importe = TxtImporte.Text.ToString.ToDecimal + } + ) + If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos + + cfdi.Comprobante.Version = "3.3" + cfdi.Comprobante.Serie = "VIA" + cfdi.Comprobante.Folio = Folio + cfdi.Comprobante.Fecha = Now + cfdi.Comprobante.Subtotal = TxtImporte.Text.ToDecimal + cfdi.Comprobante.Descuentos = 0 + cfdi.Comprobante.Total = TxtImporte.Text.ToDecimal + cfdi.Comprobante.MotivoDescuento = "" + cfdi.Comprobante.Moneda = "MXN" + cfdi.Comprobante.TipoComprobante = "N" + cfdi.Comprobante.TipoDocto = "Egs" + cfdi.Comprobante.MetodoPago = "PUE" + cfdi.Comprobante.CondicionesdePago = "" + cfdi.Comprobante.FormadePago = "99" + cfdi.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString + cfdi.Comprobante.NumCuentaPago = "" + + + cfdi.Nomina.Receptor.CURP = objPersonal.CURP + cfdi.Nomina.Receptor.NSS = objPersonal.NumeroSS + cfdi.Nomina.Receptor.FechaInicioContrato = objPersonal.FechaInicioContrato.ToShortDateString + cfdi.Nomina.Receptor.Antiguedad = $"P{AntiguedadSemanas}W" + cfdi.Nomina.Receptor.TipoContrato = objPersonal.CodigoTipoContrato + cfdi.Nomina.Receptor.CodigoTipoJornada = objPersonal.ClaveTipoJornada + cfdi.Nomina.Receptor.CodigoRegimenContratacion = If(objPersonal.CveRegimenContratacion = "", "99", objPersonal.CveRegimenContratacion) + cfdi.Nomina.Receptor.CodigoEmpleado = objPersonal.Codigo + cfdi.Nomina.Receptor.Departamento = objPersonal.Departamento + cfdi.Nomina.Receptor.Puesto = objPersonal.Puesto + cfdi.Nomina.Receptor.CodigoRiesgoPuesto = If(objPersonal.CveSATRiesgoPuesto.ToString = "0", "99", objPersonal.CveSATRiesgoPuesto.ToString) + cfdi.Nomina.Receptor.TipoPeriodo = objPersonal.TipoPeriodoPago + cfdi.Nomina.Receptor.CodigoBanco = objPersonal.ClaveBanco + cfdi.Nomina.Receptor.NumeroCuenta = objPersonal.BancoNumCuenta + cfdi.Nomina.Receptor.SDI = objPersonal.SDI + cfdi.Nomina.Receptor.SBC = objPersonal.SDI + cfdi.Nomina.Receptor.Sindicalizado = "" + cfdi.Nomina.Receptor.CodigoEntidadFederativa = objPersonal.ClaveEstado + + + cfdi.Conceptos.Add(New CFDIConceptos With {.Cantidad = 1, .ClaveUnidad = "ACT", .ClaveProdServ = "84111505", .Descripcion = "Pago de nómina", .ValorUnitario = cfdi.Comprobante.Subtotal, .Importe = cfdi.Comprobante.Subtotal, .Descuento = cfdi.Nomina.TotalDeducciones.ToDecimal}) + + objPersonal.Dispose() + Return cfdi End Function 'Private Function TimbrarBIInformNomina12(CveNomina As Integer, CvePersonal As Integer, CvePeriodo As Integer) As String @@ -2448,49 +2448,49 @@ Partial Class Bancos_IE 'End Function -#End Region +#End Region -#Region " GUARDAR - ACTUALIZAR " - Private Function ValidaGuardar() As Boolean - Dim EsValido = True - Dim PagueseA = "" - If HdnCveCliente.Value.ToEntero > 0 Then - PagueseA = DdlCliente.SelectedText.ToString() - ElseIf HdnCveProveedor.Value.ToEntero > 0 Then - PagueseA = DdlProveedores.SelectedText.ToString() - ElseIf HdnCvePersonal.Value.ToEntero > 0 Then - PagueseA = DdlPersonal.SelectedItem.ToString - End If - - If DdlEstatusIE.SelectedValue = "2" AndAlso TxtImporte.Text.ToDouble > 0 Then - Alert("Un movimiento Cancelado debe tener importe = 0", TipoMensaje.MsgAdvertencia) - EsValido = False - End If - - If DdlEstatusIE.SelectedValue <> "2" AndAlso TxtImporte.Text.ToDouble <= 0 Then - Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia) - EsValido = False - End If - - 'cuando sea activo es requerido proveedor o personal - If DdlEstatusIE.SelectedValue = "1" AndAlso (CveProveedor <= 0 And CvePersonal <= 0) AndAlso HdnTipoTransaccion.Value = "Egs" And RBL.SelectedValue <> "C" Then - Alert("Debe de seleccionar un Proveedor o un Funcionario Empleado", TipoMensaje.MsgAdvertencia) - EsValido = False - End If - - If DdlEstatusIE.SelectedValue = "1" AndAlso PagueseA = "" AndAlso Not Opcion = "EGSCREDITO" Then - Alert("Ingrese Beneficiario", TipoMensaje.MsgAdvertencia) - EsValido = False - End If - - Dim Dep As New ClsGenerales - If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor) Then - Dim Row = Dep.DtResultados.FiltroPrimero(String.Format("CveCuentaDeposito = {0}", DdlCuentaDeposito.SelectedValue.ToEntero)) - If Row IsNot Nothing AndAlso Row("Estatus").ToString = "False" Then - Alert("La cuenta depósito del proveedor esta inactiva.", TipoMensaje.MsgAdvertencia) - EsValido = False - End If - End If +#Region " GUARDAR - ACTUALIZAR " + Private Function ValidaGuardar() As Boolean + Dim EsValido = True + Dim PagueseA = "" + If HdnCveCliente.Value.ToEntero > 0 Then + PagueseA = DdlCliente.SelectedText.ToString() + ElseIf HdnCveProveedor.Value.ToEntero > 0 Then + PagueseA = DdlProveedores.SelectedText.ToString() + ElseIf HdnCvePersonal.Value.ToEntero > 0 Then + PagueseA = DdlPersonal.SelectedItem.ToString + End If + + If DdlEstatusIE.SelectedValue = "2" AndAlso TxtImporte.Text.ToDouble > 0 Then + Alert("Un movimiento Cancelado debe tener importe = 0", TipoMensaje.MsgAdvertencia) + EsValido = False + End If + + If DdlEstatusIE.SelectedValue <> "2" AndAlso TxtImporte.Text.ToDouble <= 0 Then + Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia) + EsValido = False + End If + + 'cuando sea activo es requerido proveedor o personal + If DdlEstatusIE.SelectedValue = "1" AndAlso (CveProveedor <= 0 And CvePersonal <= 0) AndAlso HdnTipoTransaccion.Value = "Egs" And RBL.SelectedValue <> "C" Then + Alert("Debe de seleccionar un Proveedor o un Funcionario Empleado", TipoMensaje.MsgAdvertencia) + EsValido = False + End If + + If DdlEstatusIE.SelectedValue = "1" AndAlso PagueseA = "" AndAlso Not Opcion = "EGSCREDITO" Then + Alert("Ingrese Beneficiario", TipoMensaje.MsgAdvertencia) + EsValido = False + End If + + Dim Dep As New ClsGenerales + If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor) Then + Dim Row = Dep.DtResultados.FiltroPrimero(String.Format("CveCuentaDeposito = {0}", DdlCuentaDeposito.SelectedValue.ToEntero)) + If Row IsNot Nothing AndAlso Row("Estatus").ToString = "False" Then + Alert("La cuenta depósito del proveedor esta inactiva.", TipoMensaje.MsgAdvertencia) + EsValido = False + End If + End If Dep.Dispose() @@ -2521,226 +2521,226 @@ Partial Class Bancos_IE Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) End If - End If - - Return EsValido - + End If + + Return EsValido + End Function - Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) - CambiaTipoMoneda() - End Sub - - - Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click - - If Not ValidaGuardar() Then - Exit Sub - End If - - Dim ObjIE As New ClsBancos() - Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) - Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) - Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL) - - ' Dim ObjContabilidad As New ClsContabilidad(ObjIE.IniciaTransacSQL) - - Dim MsgError As String = "" - Dim CveConceptoContable As Integer = 30 - Dim CveConceptoCompra As Integer = 10 - Dim CveCreditoDetalle As Integer = -1 - Dim CIF As Decimal = 0 - Dim CvePlantillaPoliza As Integer = 3 - Dim CvePrePoliza As Integer = 0 - Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" - Dim Msg As New StringBuilder - + Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs) + CambiaTipoMoneda() + End Sub + + + Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click + + If Not ValidaGuardar() Then + Exit Sub + End If + + Dim ObjIE As New ClsBancos() + Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) + Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL) + Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL) + + ' Dim ObjContabilidad As New ClsContabilidad(ObjIE.IniciaTransacSQL) + + Dim MsgError As String = "" + Dim CveConceptoContable As Integer = 30 + Dim CveConceptoCompra As Integer = 10 + Dim CveCreditoDetalle As Integer = -1 + Dim CIF As Decimal = 0 + Dim CvePlantillaPoliza As Integer = 3 + Dim CvePrePoliza As Integer = 0 + Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:

" + Dim Msg As New StringBuilder + If CveIE = -1 Then - Dim CveCuentaDeposito As Integer = 0 - If DdlCuentaDeposito.Items.Count > 0 Then - CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero - End If - - 'OBTIENE COMPROBANTE!! - ComprobanteIE = "" - Dim Comprobante As String = "" - Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos - Dim filemove As String = "" - For Each fileItem As Archivo In filesgral - Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - filemove = fileItem.filename - Next - - - '*****-_- INICIA: CONFIGURACION REGISTRO -_-***** - If CvePersonal > 0 Then - If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") And DDlCheques.SelectedValue.ToEntero > 0 Then - CveConceptoCompra = 29 'Comprobación Personal - Else - CveConceptoCompra = 28 'Prestamo Personal - End If - CveConceptoContable = 30 'Banco - CvePlantillaPoliza = 8 - End If - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then - If CvePersonal > 0 Then - CveConceptoCompra = 29 'Comprobacion Personal - CveConceptoContable = 30 'Bancos - CvePlantillaPoliza = 9 - ElseIf CveProveedor > 0 Then - CveConceptoCompra = 21 'Pago a Proveedor/CAncelacion Anticipos - CveConceptoContable = 30 'Bancos + Dim CveCuentaDeposito As Integer = 0 + If DdlCuentaDeposito.Items.Count > 0 Then + CveCuentaDeposito = DdlCuentaDeposito.SelectedValue.ToEntero + End If + + 'OBTIENE COMPROBANTE!! + ComprobanteIE = "" + Dim Comprobante As String = "" + Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos + Dim filemove As String = "" + For Each fileItem As Archivo In filesgral + Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + filemove = fileItem.filename + Next + + + '*****-_- INICIA: CONFIGURACION REGISTRO -_-***** + If CvePersonal > 0 Then + If Opcion IsNot Nothing AndAlso Opcion.Contiene("EGSSINFACT") And DDlCheques.SelectedValue.ToEntero > 0 Then + CveConceptoCompra = 29 'Comprobación Personal + Else + CveConceptoCompra = 28 'Prestamo Personal + End If + CveConceptoContable = 30 'Banco + CvePlantillaPoliza = 8 + End If + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then + If CvePersonal > 0 Then + CveConceptoCompra = 29 'Comprobacion Personal + CveConceptoContable = 30 'Bancos + CvePlantillaPoliza = 9 + ElseIf CveProveedor > 0 Then + CveConceptoCompra = 21 'Pago a Proveedor/CAncelacion Anticipos + CveConceptoContable = 30 'Bancos CvePlantillaPoliza = 7 ElseIf CveCliente > 0 Then - CvePlantillaPoliza = 11 - End If - End If - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then - If CveCliente > 0 Then - CveConceptoCompra = 3 'Clientes - CveConceptoContable = 30 'Bancos - CvePlantillaPoliza = 12 - End If + CvePlantillaPoliza = 11 + End If + End If + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then + If CveCliente > 0 Then + CveConceptoCompra = 3 'Clientes + CveConceptoContable = 30 'Bancos + CvePlantillaPoliza = 12 + End If End If If Opcion = "DevDinC" Then CvePlantillaPoliza = 2 - End If - - 'Cuando es Egreso sin factura, se registra una compra tipo anticipo - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSCREDITO" Then - CveConceptoCompra = 48 'Anticipo Acreedores - CveConceptoContable = 30 'Bancos - CveCreditoDetalle = DdlCreditoDetalle.SelectedValue.ToEntero - Dim Estatus As Integer = 2 - If HdnCveTipoCredito.Value = "1" Then - Estatus = 103 - 'cuando es crediproveedores es, pago a documentos por pagar - CveConceptoCompra = 57 - End If - ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) - - If HdnImporteCredito.Value.ToDouble > 0 AndAlso TxtImporte.Text.ToDouble > HdnImporteCredito.Value.ToDouble Then - CIF = TxtImporte.Text.ToDecimal - HdnImporteCredito.Value.ToDecimal - Else - CIF = 0 - End If - - CvePlantillaPoliza = 92 - - End If - Dim AgregaPolizaSaldoInicial As Boolean = False - 'Cuando es Egreso sin factura, se registra una compra tipo anticipo - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then - Select Case RBL.SelectedValue - Case "P" 'Proveedores - If CveProveedor > 0 Then - CveConceptoCompra = 10 'Anticipo a proveedor - CveConceptoContable = 30 'Pago a Proveedor - CvePlantillaPoliza = 3 - End If - Case "DD" ' Deudores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 43 'Prestamo a deudor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 6 - End If - Case "AC" ' Acreedores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 42 'Prestamo a acreedor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 21 - End If - Case "DP" ' Documentos por pagar - If CveProveedor > 0 Then - CveConceptoCompra = 50 'Anticipo doc por pagar - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 22 - End If - Case "FE" - AgregaPolizaSaldoInicial = True - End Select - End If - - 'Nuevo Formato Charlie - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 6 - Select Case RBL.SelectedValue - Case "DD" ' Deudores Diversos - If CveProveedor > 0 Then - CveConceptoCompra = 37 'Prestamo a deudor diverso - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - CvePlantillaPoliza = 45 - End If - Case "C" ' Clientes - If CveCliente > 0 Then - CveConceptoCompra = 66 'Anticipo doc por pagar - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - End If - Case "AC" ' Acreedores Diversos - If CveCliente > 0 Then - CveConceptoCompra = 41 - CveConceptoContable = 30 'Bancos - 'limpio el iva - HdnProvPorIVA.Value = "0" - End If - End Select - End If - - '*****-_- TERMINA: CONFIGURACION REGISTRO -_-***** - - - Dim FolioFijo As Integer = 0 - Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero - Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal - If tCveMoneda <> 1 Then tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL - Dim PagueseA = "" - - If HdnCveCliente.Value.ToEntero > 0 Then - PagueseA = DdlCliente.SelectedText.ToString() - ElseIf HdnCveProveedor.Value.ToEntero > 0 Then - PagueseA = DdlProveedores.SelectedText.ToString() - ElseIf HdnCvePersonal.Value.ToEntero > 0 Then - PagueseA = DdlPersonal.SelectedItem.ToString - ElseIf DdlCreditoDetalle.SelectedValue.ToEntero > 0 Then - PagueseA = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) - End If - - If AgregaPolizaSaldoInicial Then - If AgregarSaldoInicial(TxtImporte.Text.ToDouble(), TxtFechaDocumento.Text.ToDateTime(), DdlMoneda.SelectedValue.ToEntero(), ObjMov) <= 0 Then - MsgError = "No se pudo insertar la póliza de saldo inicial." - End If - End If + End If + + 'Cuando es Egreso sin factura, se registra una compra tipo anticipo + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSCREDITO" Then + CveConceptoCompra = 48 'Anticipo Acreedores + CveConceptoContable = 30 'Bancos + CveCreditoDetalle = DdlCreditoDetalle.SelectedValue.ToEntero + Dim Estatus As Integer = 2 + If HdnCveTipoCredito.Value = "1" Then + Estatus = 103 + 'cuando es crediproveedores es, pago a documentos por pagar + CveConceptoCompra = 57 + End If + ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) + + If HdnImporteCredito.Value.ToDouble > 0 AndAlso TxtImporte.Text.ToDouble > HdnImporteCredito.Value.ToDouble Then + CIF = TxtImporte.Text.ToDecimal - HdnImporteCredito.Value.ToDecimal + Else + CIF = 0 + End If + + CvePlantillaPoliza = 92 + + End If + Dim AgregaPolizaSaldoInicial As Boolean = False + 'Cuando es Egreso sin factura, se registra una compra tipo anticipo + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then + Select Case RBL.SelectedValue + Case "P" 'Proveedores + If CveProveedor > 0 Then + CveConceptoCompra = 10 'Anticipo a proveedor + CveConceptoContable = 30 'Pago a Proveedor + CvePlantillaPoliza = 3 + End If + Case "DD" ' Deudores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 43 'Prestamo a deudor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 6 + End If + Case "AC" ' Acreedores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 42 'Prestamo a acreedor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 21 + End If + Case "DP" ' Documentos por pagar + If CveProveedor > 0 Then + CveConceptoCompra = 50 'Anticipo doc por pagar + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 22 + End If + Case "FE" + AgregaPolizaSaldoInicial = True + End Select + End If + + 'Nuevo Formato Charlie + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 6 + Select Case RBL.SelectedValue + Case "DD" ' Deudores Diversos + If CveProveedor > 0 Then + CveConceptoCompra = 37 'Prestamo a deudor diverso + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + CvePlantillaPoliza = 45 + End If + Case "C" ' Clientes + If CveCliente > 0 Then + CveConceptoCompra = 66 'Anticipo doc por pagar + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + End If + Case "AC" ' Acreedores Diversos + If CveCliente > 0 Then + CveConceptoCompra = 41 + CveConceptoContable = 30 'Bancos + 'limpio el iva + HdnProvPorIVA.Value = "0" + End If + End Select + End If + + '*****-_- TERMINA: CONFIGURACION REGISTRO -_-***** + + + Dim FolioFijo As Integer = 0 + Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero + Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal + If tCveMoneda <> 1 Then tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL + Dim PagueseA = "" + + If HdnCveCliente.Value.ToEntero > 0 Then + PagueseA = DdlCliente.SelectedText.ToString() + ElseIf HdnCveProveedor.Value.ToEntero > 0 Then + PagueseA = DdlProveedores.SelectedText.ToString() + ElseIf HdnCvePersonal.Value.ToEntero > 0 Then + PagueseA = DdlPersonal.SelectedItem.ToString + ElseIf DdlCreditoDetalle.SelectedValue.ToEntero > 0 Then + PagueseA = String.Format("{0} {1} {2}", DdlFinanciera.SelectedItem.Text, DdlCredito.SelectedItem.Text, DdlCreditoDetalle.SelectedItem.Text) + End If + + If AgregaPolizaSaldoInicial Then + If AgregarSaldoInicial(TxtImporte.Text.ToDouble(), TxtFechaDocumento.Text.ToDateTime(), DdlMoneda.SelectedValue.ToEntero(), ObjMov) <= 0 Then + MsgError = "No se pudo insertar la póliza de saldo inicial." + End If + End If Dim UsaComplementariaBancos As Boolean = False - UsaComplementariaBancos = True - - If MsgError = "" Then - - - - CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, + UsaComplementariaBancos = True + + If MsgError = "" Then + + + + CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), - ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte, CveOCAnticipo:=CveOCSolicitudAnticipo) - - If CveIE > 0 Then - - - + CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), + ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"), CveCorte:=Me.CveCorte, CveOCAnticipo:=CveOCSolicitudAnticipo) + + If CveIE > 0 Then + + + If DdlCuentaDeposito.SelectedValue.ToEntero > 0 And DdlTipoTransaccion.SelectedValue = "17" Then If TxtReferenciaCIE.Text <> OriReferenciaCIE Or TxtConceptoCIE.Text <> OriConceptoCIE Then @@ -2754,232 +2754,232 @@ Partial Class Bancos_IE End If - End If - - If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = ObjIE.Folio.ToEntero 'cheque - CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) - - 'valida prepoliza - If CvePrePoliza > 0 Then - - If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then - MsgError = "Ocurrio un error al agregar la prepoliza al IE." - End If - - Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) - Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) - - If Comprobante <> "" Then - ComprobanteIE = $"{CveIE}.{Comprobante}" - End If - - 'GUARDA COMPROBANTE - If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) - End If - - 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs - Select Case Opcion - Case "DEV" - Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE) - - If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then - 'RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES - Dim Mov As New ClsMovimientos - If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then - Dim DtIE As DataTable = Mov.DtResultados - For Each dr As DataRow In DtIE.Rows - - If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, dr("Importe").ToString.ToDecimal), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, -dr("Importe").ToString.ToDecimal), ImporteME:=tImporteMonedaExtranjera) Then - MsgError = "no se pudo insertar el detalle de la póliza 2" - End If - Next - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) - - End If - Mov.Dispose() - - 'Devolucion de INGxC Formato Charlie - ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then - - Dim Mov As New ClsMovimientos - 'INGxC - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), ImporteME:=tImporteMonedaExtranjera) - - If TxtIvaIxC.Text.ToDouble > 0 Then - Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) - 'Iva - ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0)) - End If - - 'Bancos - ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDecimal, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) - Mov.Dispose() - - Else - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera) Then - MsgError = "no se pudo insertar el detalle de la póliza 2" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza" - End If - - End If - - - Case "INGPC" - Dim ConceptoContable As Integer - Dim TipoMovimiento As Boolean - Dim importeMovimiento As Decimal - Dim FechaMovimiento As Date = Now - Dim Concepto As String = "" - Dim Referencia As String = PagueseA - - Dim importeMX As Decimal - Dim Multiplicador As Integer - - If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - - For Each Row As DataRow In ObjMov.DtResultados.Rows - - ConceptoContable = Row("CveConcepto").ToString.ToEntero - TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) - importeMovimiento = 0 - Multiplicador = (Row("Multiplicador").ToString.ToEntero) - Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) - - Select Case ConceptoContable - - Case 10 - If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 28 - If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 37 - If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 41 - If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 46 - - If TxtInteresMoratorio.Text.ToDecimal > 0 Then - importeMovimiento = TxtInteresMoratorio.Text.ToDecimal - importeMX = importeMovimiento - Else - importeMovimiento = 0 - importeMX = 0 - End If - - - Case 50 - If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - End If - - Case 66 - If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then - importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal - importeMX = importeMovimiento - - 'Agregamos el IVA - If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then - Dim CveConIVA As Integer = 61 - If UsuarioActual.CveEmpresa = 70 Then CveConIVA = 299 - Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - If tCveMoneda > 1 Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - - End If - - End If - - Case 30 - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - - If tCveMoneda > 1 AndAlso UsaComplementariaBancos Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + + If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = ObjIE.Folio.ToEntero 'cheque + CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)) + + 'valida prepoliza + If CvePrePoliza > 0 Then + + If Not ObjIE.UpdateIEPrePoliza(MinFecha, "", -1, CvePrePoliza, CveIE, -1) Then + MsgError = "Ocurrio un error al agregar la prepoliza al IE." + End If + + Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) + Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text) + + If Comprobante <> "" Then + ComprobanteIE = $"{CveIE}.{Comprobante}" + End If + + 'GUARDA COMPROBANTE + If filemove <> "" Then + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) + End If + + 'GUARDA PREPOLIZAS DETALLE [PRIMERO SON LOS CASOS ESPECIALES, AL FINAL (ELSE) LOS CASOS NORMALES] --REEMPLAZA IFs + Select Case Opcion + Case "DEV" + Dim CveIEOtro As Integer = If(CveProveedor > 0 Or CvePersonal > 0, DdlIEDevolucion.SelectedValue.ToEntero, CveIE) + + If CveCliente > 0 AndAlso Not DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDouble = 0 Then + 'RMF- CASO DONDE HAY UNA DEVOLUCION Y TENGO QUE AFECTAR LAS FACTURAS QUE SE HABIAN MARCADO COMO PAGADAS TENGO QUE REGRESARLAS A PENDIENTES + Dim Mov As New ClsMovimientos + If Mov.GetMovimientosIE(2, DdlIEDevolucion.SelectedValue.ToEntero, -1, Now, Now, 1, 0, UsuarioActual.CveEmpresa) Then + Dim DtIE As DataTable = Mov.DtResultados + For Each dr As DataRow In DtIE.Rows + + If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, If(dr("TipoMovto").ToString.ToEntero = 1, False, True), If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, dr("Importe").ToString.ToDecimal), "", dr("CveConceptoContable").ToString.ToEntero, "", Now, IDCtaBeneficiario, -1, CveIE, CveCliente:=dr("CveCliente").ToString.ToEntero, CveVenta:=dr("CveVenta").ToString.ToEntero, ImporteMX:=If(dr("CveConceptoContable").ToString.ToEntero.Contiene(66), -TxtImporte.Text.ToDecimal, -dr("Importe").ToString.ToDecimal), ImporteME:=tImporteMonedaExtranjera) Then + MsgError = "no se pudo insertar el detalle de la póliza 2" + End If + Next + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) + + End If + Mov.Dispose() + + 'Devolucion de INGxC Formato Charlie + ElseIf CveCliente > 0 AndAlso DivIvaIxC.Visible Then + + Dim Mov As New ClsMovimientos + 'INGxC + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), Ref, 66, Conc, Now, IDCtaContable, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-(TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal), ImporteME:=tImporteMonedaExtranjera) + + If TxtIvaIxC.Text.ToDouble > 0 Then + Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) + 'Iva + ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -TxtIvaIxC.Text.ToDecimal, Ref, 61, Conc, Now, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=If(PorcentajeIVA.ToString().Contiene("0.08", "0.16"), PorcentajeIVA, 0)) + End If + + 'Bancos + ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, -TxtImporte.Text.ToDecimal, Ref, 30, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveIEDevolucion:=DdlIEDevolucion.SelectedValue.ToEntero, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=-TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) + Mov.Dispose() + + Else + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE:=If(CveIEOtro < 0, CveIE, CveIEOtro), CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=tImporteMonedaExtranjera, ImporteME:=tImporteMonedaExtranjera) Then + MsgError = "no se pudo insertar el detalle de la póliza 2" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza" + End If + + End If + + + Case "INGPC" + Dim ConceptoContable As Integer + Dim TipoMovimiento As Boolean + Dim importeMovimiento As Decimal + Dim FechaMovimiento As Date = Now + Dim Concepto As String = "" + Dim Referencia As String = PagueseA + + Dim importeMX As Decimal + Dim Multiplicador As Integer + + If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then + + For Each Row As DataRow In ObjMov.DtResultados.Rows + + ConceptoContable = Row("CveConcepto").ToString.ToEntero + TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) + importeMovimiento = 0 + Multiplicador = (Row("Multiplicador").ToString.ToEntero) + Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) + + Select Case ConceptoContable + + Case 10 + If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 28 + If RBL.SelectedValue = "FE" AndAlso CvePersonal > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 37 + If RBL.SelectedValue = "DD" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 41 + If RBL.SelectedValue = "AC" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 46 + + If TxtInteresMoratorio.Text.ToDecimal > 0 Then + importeMovimiento = TxtInteresMoratorio.Text.ToDecimal + importeMX = importeMovimiento + Else + importeMovimiento = 0 + importeMX = 0 + End If + + + Case 50 + If RBL.SelectedValue = "DP" AndAlso CveProveedor > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + End If + + Case 66 + If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then + importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal + importeMX = importeMovimiento + + 'Agregamos el IVA + If DivIvaIxC.Visible AndAlso TxtIvaIxC.Text.ToDecimal <> 0 Then + Dim CveConIVA As Integer = 61 + If UsuarioActual.CveEmpresa = 70 Then CveConIVA = 299 + Dim PorcentajeIVA = (TxtIvaIxC.Text.ToDecimal() / (TxtImporte.Text.ToDecimal() - TxtIvaIxC.Text.ToDecimal())).RoundSQL(2) + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtIvaIxC.Text.ToDecimal, Concepto, CveConIVA, Concepto, FechaMovimiento, UsuarioActual.Empresa.IdCuentaIVAxTrasladar, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtIvaIxC.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, PorcentajeImpuesto:=PorcentajeIVA) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + If tCveMoneda > 1 Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 226, Concepto, FechaMovimiento, IDCtaBeneficiarioComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + + End If + + End If + + Case 30 + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + + If tCveMoneda > 1 AndAlso UsaComplementariaBancos Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." End If Else If tCveMoneda > 1 Then Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal importeMX = (importeMovimiento * TC).RoundSQL - End If - End If - - End Select - - If importeMovimiento <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - - Next - - End If - - - Case "DevDinV" - Dim IdCtaContableAplicar = -1 - Dim ImporteAplicar = 0.0D - Dim ImporteAplicarMN = 0.0D - Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = ObjIE.Folio - Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}" - - ImporteAplicar = TxtImporte.Text.ToDecimal - ImporteAplicarME = ImporteAplicar - - 'CONSIDERA COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 Then - ImporteAplicarMN = ImporteAplicar - Else - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - End If - - 'BANCOS - IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" - Exit Select - End If - - 'BANCOS COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 Then - ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)) - ImporteAplicar).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If + End If + End If + + End Select + + If importeMovimiento <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + + Next + + End If + + + Case "DevDinV" + Dim IdCtaContableAplicar = -1 + Dim ImporteAplicar = 0.0D + Dim ImporteAplicarMN = 0.0D + Dim ImporteAplicarME = 0.0D + Dim ReferenciaAplicar = ObjIE.Folio + Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}" + + ImporteAplicar = TxtImporte.Text.ToDecimal + ImporteAplicarME = ImporteAplicar + + 'CONSIDERA COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 Then + ImporteAplicarMN = ImporteAplicar + Else + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + End If + + 'BANCOS + IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" + Exit Select + End If + + 'BANCOS COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 Then + ImporteAplicarMN = ((ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)) - ImporteAplicar).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ReferenciaAplicar, 204, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If End If 'OTROS INGRESOS/EGRESOS @@ -3003,87 +3003,87 @@ Partial Class Bancos_IE MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" Exit Select End If - End If - - 'CANCELA NC - IdCtaContableAplicar = IDCtaBeneficiario - ImporteAplicar = ImporteAplicar + Impo - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then - MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" - Exit Select + End If + + 'CANCELA NC + IdCtaContableAplicar = IDCtaBeneficiario + ImporteAplicar = ImporteAplicar + Impo + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then + MsgError = "Ocurrió un error al registrar el asiento de pago de devolución" + Exit Select End If 'IMPUESTOS - If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin, UsuarioActual.CveEmpresa) Then - Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) - Dim CveConceptoContableAplciar = -1 - Dim TipoMovtoAplicar = False - - For Each Dr As DataRow In ObjMov.DtResultados.FiltraParametros("CveConceptoContable IN (13,8,9,38)").Rows - Dim PorcentajeImpuesto As Decimal = Dr("PorcentajeImpuesto").ToString.ToDecimal() - CveConceptoContableAplciar = Dr("CveConceptoContable").ToString.ToEntero - TipoMovtoAplicar = Not CBool(Dr("TipoMovto").ToString) - ImporteAplicar = (Dr("Importe").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - ImporteAplicarMN = (Dr("ImporteMN").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - ImporteAplicarME = (Dr("ImporteME").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() - IdCtaContableAplicar = Dr("IdCtaContable").ToString.ToEntero - - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=PorcentajeImpuesto) Then - Select Case CveConceptoContableAplciar - Case 13 - CveConceptoContableAplciar = 61 - Case 8 - CveConceptoContableAplciar = 62 - Case 9 - CveConceptoContableAplciar = 63 - Case 38 - CveConceptoContableAplciar = 39 - End Select - TipoMovtoAplicar = Not TipoMovtoAplicar - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=PorcentajeImpuesto) Then - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - Exit Select - End If - Else - MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" - Exit Select - End If - - Next - End If - - Case "DevDinC" - 'asdasdasd - 'asdasdasdasd - Dim IdCtaContableAplicar = -1 - Dim ImporteAplicar = 0.0D - Dim ImporteAplicarMN = 0.0D - Dim ImporteAplicarME = 0.0D - Dim ReferenciaAplicar = ObjIE.Folio - - Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" - - ImporteAplicar = TxtImporte.Text.ToDecimal - ImporteAplicarME = ImporteAplicar - - - 'CONSIDERA COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 Then - ImporteAplicarMN = ImporteAplicar - Else - ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() - End If - - Dim TCCompra As Decimal = 1 + If ObjMov.GetPrePolizasDetalle(CvePrePolizaDevDin, UsuarioActual.CveEmpresa) Then + Dim PorcentajePagoDevDin = (TxtImporte.Text.ToDecimal / ImporteOriginalDevDin).RoundSQL(6) + Dim CveConceptoContableAplciar = -1 + Dim TipoMovtoAplicar = False + + For Each Dr As DataRow In ObjMov.DtResultados.FiltraParametros("CveConceptoContable IN (13,8,9,38)").Rows + Dim PorcentajeImpuesto As Decimal = Dr("PorcentajeImpuesto").ToString.ToDecimal() + CveConceptoContableAplciar = Dr("CveConceptoContable").ToString.ToEntero + TipoMovtoAplicar = Not CBool(Dr("TipoMovto").ToString) + ImporteAplicar = (Dr("Importe").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + ImporteAplicarMN = (Dr("ImporteMN").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + ImporteAplicarME = (Dr("ImporteME").ToString.ToDecimal * PorcentajePagoDevDin).RoundSQL() + IdCtaContableAplicar = Dr("IdCtaContable").ToString.ToEntero + + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=PorcentajeImpuesto) Then + Select Case CveConceptoContableAplciar + Case 13 + CveConceptoContableAplciar = 61 + Case 8 + CveConceptoContableAplciar = 62 + Case 9 + CveConceptoContableAplciar = 63 + Case 38 + CveConceptoContableAplciar = 39 + End Select + TipoMovtoAplicar = Not TipoMovtoAplicar + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAplicar, ImporteAplicar, ReferenciaAplicar, CveConceptoContableAplciar, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, PorcentajeImpuesto:=PorcentajeImpuesto) Then + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + Exit Select + End If + Else + MsgError = "Ocurrió un error al registrar el asiento de impuestos de devolución" + Exit Select + End If + + Next + End If + + Case "DevDinC" + 'asdasdasd + 'asdasdasdasd + Dim IdCtaContableAplicar = -1 + Dim ImporteAplicar = 0.0D + Dim ImporteAplicarMN = 0.0D + Dim ImporteAplicarME = 0.0D + Dim ReferenciaAplicar = ObjIE.Folio + + Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}" + + ImporteAplicar = TxtImporte.Text.ToDecimal + ImporteAplicarME = ImporteAplicar + + + 'CONSIDERA COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 Then + ImporteAplicarMN = ImporteAplicar + Else + ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL() + End If + + Dim TCCompra As Decimal = 1 Dim TCDocumento As Decimal = 1 'BANCOS - IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, TipoCambio:=TCDocumento) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" - Exit Select + IdCtaContableAplicar = If(IDCtaContable > 0, IDCtaContable, 0) + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteAplicar, ReferenciaAplicar, 30, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicarME, TipoCambio:=TCDocumento) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos de devolución" + Exit Select End If @@ -3575,218 +3575,218 @@ Partial Class Bancos_IE '''''''''''''''''''''''''''''''''''''''''''''' - Case "EGSCREDITO" - - Dim ConceptoContable As Integer - Dim TipoMovimiento As Boolean - Dim importeMovimiento As Decimal - Dim FechaMovimiento As Date = Now - Dim Concepto As String = "" - Dim Referencia As String = PagueseA - - Dim importeMX As Decimal - Dim Multiplicador As Integer - - If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then - - For Each Row As DataRow In ObjMov.DtResultados.Rows - - ConceptoContable = Row("CveConcepto").ToString.ToEntero - TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) - importeMovimiento = 0 - Multiplicador = (Row("Multiplicador").ToString.ToEntero) - Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) - - Select Case ConceptoContable - - Case 30 - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - If tCveMoneda > 1 Then - 'Agregamos complementaria - Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal - - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - Case 42 - - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento + Case "EGSCREDITO" + + Dim ConceptoContable As Integer + Dim TipoMovimiento As Boolean + Dim importeMovimiento As Decimal + Dim FechaMovimiento As Date = Now + Dim Concepto As String = "" + Dim Referencia As String = PagueseA + + Dim importeMX As Decimal + Dim Multiplicador As Integer + + If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then + + For Each Row As DataRow In ObjMov.DtResultados.Rows + + ConceptoContable = Row("CveConcepto").ToString.ToEntero + TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False) + importeMovimiento = 0 + Multiplicador = (Row("Multiplicador").ToString.ToEntero) + Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio) + + Select Case ConceptoContable + + Case 30 + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + If tCveMoneda > 1 Then + 'Agregamos complementaria + Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal + + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + Case 42 + + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento If tCveMoneda > 1 Then importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal importeMX = importeMovimiento - End If - - - Case 46 - If TxtInteresMoratorio.Text.ToDecimal > 0 Then - importeMovimiento = TxtInteresMoratorio.Text.ToDecimal - importeMX = importeMovimiento - Else - importeMovimiento = 0 - importeMX = 0 - End If - Case 48 - - importeMovimiento = TxtImporte.Text.ToDecimal - importeMX = importeMovimiento - - End Select - - If importeMovimiento <> 0 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento del ingreso." - End If - End If - - Next - End If - - Case Else - Dim TipoMovimiento As Boolean = True - - If Opcion.Contiene("ANTC") Then - TipoMovimiento = False - End If - - If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsaComplementariaBancos Then + End If + + + Case 46 + If TxtInteresMoratorio.Text.ToDecimal > 0 Then + importeMovimiento = TxtInteresMoratorio.Text.ToDecimal + importeMX = importeMovimiento + Else + importeMovimiento = 0 + importeMX = 0 + End If + Case 48 + + importeMovimiento = TxtImporte.Text.ToDecimal + importeMX = importeMovimiento + + End Select + + If importeMovimiento <> 0 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento del ingreso." + End If + End If + + Next + End If + + Case Else + Dim TipoMovimiento As Boolean = True + + If Opcion.Contiene("ANTC") Then + TipoMovimiento = False + End If + + If CveConceptoCompra = 10 AndAlso DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsaComplementariaBancos Then IDCtaBeneficiario = IdCtaAnticipoExtranjera - End If - - 'MOVIMIENTOS EGRESOS - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then - If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - MsgError = "Detalle" - End If - 'intereses pagados - If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then - MsgError = "Detalle" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza2" - End If - Else - MsgError = "no se pudo insertar el detalle de la póliza" - End If - - 'BANCOS COMPLEMENTARIA - If DdlMoneda.SelectedValue.ToEntero > 1 Then - Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal - Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - - If CveConceptoCompra = 10 Then - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then - MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" - End If - End If - End If - - If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then - If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then - MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico." - End If - End If - + End If + + 'MOVIMIENTOS EGRESOS + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble + If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then + If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + MsgError = "Detalle" + End If + 'intereses pagados + If CIF > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, CIF, Ref, 46, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=CIF, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then + MsgError = "Detalle" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza2" + End If + Else + MsgError = "no se pudo insertar el detalle de la póliza" + End If + + 'BANCOS COMPLEMENTARIA + If DdlMoneda.SelectedValue.ToEntero > 1 Then + Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal + Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + + If CveConceptoCompra = 10 Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then + MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" + End If + End If + End If + + If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then + If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then + MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico." + End If + End If + End Select - - - If UsuarioActual.Empresa.UsaAC Then - Dim ConceptoRenglon, Referencia As String - Dim FolioPoliza As Integer - Dim Fecha As Date = TxtFechaDocumento.Text.ToDate - Dim TipoChq As String = "" - Dim Total As Double = TxtImporte.Text.ToDouble - - Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) - Conta.IniciaTransacSQL() - - If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ" - ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) - - IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) - - If IDPoliza > 0 Then - FolioPoliza = Conta.Folio - Referencia = ObjIE.Folio - ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) - - Total = TxtImporte.Text.ToDouble - - If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - Else - MsgError = "No se insertó el encabezado" - End If - - If MsgError = "" Then - Conta.Commit() - - Conta.AjustaPoliza(IDPoliza) - 'actualizar la conta del IE - ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) - Else - Conta.RollBack() - IDPoliza = 0 - End If - - Conta.Dispose() - End If - - 'Notificación de Pago - If TxtNotificarA.Text.Trim <> "" And MsgError = "" Then - 'NotificacionPago(CveIE, TxtNotificarA.Text.Trim) - EnviarCorreoNotificacion(CveIE, TxtNotificarA.Text.Trim, "", UsuarioActual, False) - End If - - Else - MsgError = "No se pudo insertar la póliza" - End If - - Else - MsgError = "No se insertó el encabezado" - End If - - End If - - Else - Msg.Append("El Documento se guardó correctamente.") - - End If - - 'SOLICITUD DE ANTICIPO OC - If MsgError = "" Then - MsgError = GuardaSolicitudAnticipoOC(ObjOC) - End If - - If MsgError = "" Then - 'VIATICOS - If ChkAplicaViatico.Checked Then - Dim Retorno As String = TimbrarNomina12(CvePersonal) - If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1 - If Retorno <> "" Then - Alert(Retorno, TipoMensaje.MsgError) - End If - End If - End If - - If MsgError = "" Then - If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - ' MsgError = ObjMov.MensajePolizaDescuadre - GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - End If - Else - MsgError = "No se pudo validar la prepoliza de cuadre." - End If + + + If UsuarioActual.Empresa.UsaAC Then + Dim ConceptoRenglon, Referencia As String + Dim FolioPoliza As Integer + Dim Fecha As Date = TxtFechaDocumento.Text.ToDate + Dim TipoChq As String = "" + Dim Total As Double = TxtImporte.Text.ToDouble + + Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) + Conta.IniciaTransacSQL() + + If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ" + ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) + + IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) + + If IDPoliza > 0 Then + FolioPoliza = Conta.Folio + Referencia = ObjIE.Folio + ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) + + Total = TxtImporte.Text.ToDouble + + If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" + + Else + MsgError = "No se insertó el encabezado" + End If + + If MsgError = "" Then + Conta.Commit() + + Conta.AjustaPoliza(IDPoliza) + 'actualizar la conta del IE + ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) + Else + Conta.RollBack() + IDPoliza = 0 + End If + + Conta.Dispose() + End If + + 'Notificación de Pago + If TxtNotificarA.Text.Trim <> "" And MsgError = "" Then + 'NotificacionPago(CveIE, TxtNotificarA.Text.Trim) + EnviarCorreoNotificacion(CveIE, TxtNotificarA.Text.Trim, "", UsuarioActual, False) + End If + + Else + MsgError = "No se pudo insertar la póliza" + End If + + Else + MsgError = "No se insertó el encabezado" + End If + + End If + + Else + Msg.Append("El Documento se guardó correctamente.") + + End If + + 'SOLICITUD DE ANTICIPO OC + If MsgError = "" Then + MsgError = GuardaSolicitudAnticipoOC(ObjOC) + End If + + If MsgError = "" Then + 'VIATICOS + If ChkAplicaViatico.Checked Then + Dim Retorno As String = TimbrarNomina12(CvePersonal) + If Retorno <> "" Then MsgError = $"{MsgError} {Retorno}" : Msg.Clear() : CveIE = -1 + If Retorno <> "" Then + Alert(Retorno, TipoMensaje.MsgError) + End If + End If + End If + + If MsgError = "" Then + If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + ' MsgError = ObjMov.MensajePolizaDescuadre + GuardaLogAD($"Bancos/IE | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + End If + Else + MsgError = "No se pudo validar la prepoliza de cuadre." + End If End If @@ -3810,97 +3810,97 @@ Partial Class Bancos_IE Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) End If End If - End If - - If MsgError = "" Then - 'IMPRIME CHEQUE - 'GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) - If Msg.ToString = "" Then - Msg.Append("El Documento se guardo correctamente") - End If - Dim Archivo As System.IO.FileInfo = Nothing - 'VERIFICA SI EXISTE EL FORMATO - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta)) - ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) - If Not Archivo.Exists Then - Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", ModExtensiones.DirectorioBaseEmpresas)) - End If - ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then - Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) - End If - - If Archivo IsNot Nothing Then - If Archivo.Exists Then - Msg.AppendFormat("

{1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) - End If - End If - - If IDPoliza > 0 Then - Msg.AppendFormat("

Ver Póliza", IDPoliza) - End If - - 'AUTO DESCARGAR PDF PARA COMPU - If UsuarioActual.CveEmpresa.Contiene(72, 1, 2) And CveSolicitudViatico > 0 Then - If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 2, 6, 8, 9) Then - RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) - End If - End If - ObjIE.Commit() - - Else - ObjIE.RollBack() - Alert(MsgError, TipoMensaje.MsgAdvertencia) + End If + + If MsgError = "" Then + 'IMPRIME CHEQUE + 'GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) + If Msg.ToString = "" Then + Msg.Append("El Documento se guardo correctamente") + End If + Dim Archivo As System.IO.FileInfo = Nothing + 'VERIFICA SI EXISTE EL FORMATO + If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(2, 8, 9) Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/Transferencia.rdlc", UsuarioActual.Empresa.Ruta)) + ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1) Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/CHQ-{1}.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + If Not Archivo.Exists Then + Archivo = New System.IO.FileInfo(String.Format("{0}\Empresas\Grales\Formatos\CHQ.rdlc", ModExtensiones.DirectorioBaseEmpresas)) + End If + ElseIf DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(6) And UsuarioActual.CveEmpresa = 72 Then + Archivo = New System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero)) + End If + + If Archivo IsNot Nothing Then + If Archivo.Exists Then + Msg.AppendFormat("

{1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) + End If + End If + + If IDPoliza > 0 Then + Msg.AppendFormat("

Ver Póliza", IDPoliza) + End If + + 'AUTO DESCARGAR PDF PARA COMPU + If UsuarioActual.CveEmpresa.Contiene(72, 1, 2) And CveSolicitudViatico > 0 Then + If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 2, 6, 8, 9) Then + RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)) + End If + End If + ObjIE.Commit() + + Else + ObjIE.RollBack() + Alert(MsgError, TipoMensaje.MsgAdvertencia) If Opcion = "INGPC" Then CveIE = -1 - End If - End If - - If Msg.ToString <> "" Then - If CveOCSolicitudAnticipo > 0 Then - Alert("El Documento se guardo correctamente", TipoMensaje.MsgInformacion, "document.location.href=""../Inicio.aspx""") - Else - If ChkAplicaViatico.Checked Then - Dim SerieFolio = $"VIA-{Folio}" - Msg.Clear() - Msg.AppendFormat("", Encripta(String.Format("OP=DesXmlVIA&SERIEFOLIO={0}&TIPO={1}", SerieFolio, "Viaticos"))) - End If - - Dim AccionJS = "" - - If Opcion = "DevDinV" Then - AccionJS = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";" - - AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.AbsolutePath) - Else - AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery) - End If - - - If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then - AccionJS = $"document.location.href=""/Bancos/Creditos.aspx?CveCredito={Request("CveCredito")}"";" - Alert(Msg.ToString, TipoMensaje.MsgInformacion, AccionJS) - Else - Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)) - End If - - - - - End If - End If - - Msg.Clear() - RecargaGlobalCuentasBancarias() - ObjIE.Dispose() - ObjMov.Dispose() - If ObjComp IsNot Nothing Then ObjComp.Dispose() - - + End If + End If + + If Msg.ToString <> "" Then + If CveOCSolicitudAnticipo > 0 Then + Alert("El Documento se guardo correctamente", TipoMensaje.MsgInformacion, "document.location.href=""../Inicio.aspx""") + Else + If ChkAplicaViatico.Checked Then + Dim SerieFolio = $"VIA-{Folio}" + Msg.Clear() + Msg.AppendFormat("", Encripta(String.Format("OP=DesXmlVIA&SERIEFOLIO={0}&TIPO={1}", SerieFolio, "Viaticos"))) + End If + + Dim AccionJS = "" + + If Opcion = "DevDinV" Then + AccionJS = $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}"";" + + AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.AbsolutePath) + Else + AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery) + End If + + + If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then + AccionJS = $"document.location.href=""/Bancos/Creditos.aspx?CveCredito={Request("CveCredito")}"";" + Alert(Msg.ToString, TipoMensaje.MsgInformacion, AccionJS) + Else + Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)) + End If + + + + + End If + End If + + Msg.Clear() + RecargaGlobalCuentasBancarias() + ObjIE.Dispose() + ObjMov.Dispose() + If ObjComp IsNot Nothing Then ObjComp.Dispose() + + End Sub -#Region " NOTIFICACION PAGO " +#Region " NOTIFICACION PAGO " @@ -6622,8 +6622,9 @@ Partial Class Bancos_IE End If Else + Dim CveSATMotivoCancelacion As Integer = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion:=2).FiltroPrimeroValor("CveSATMotivoCancelacion").ToEntero() - If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then + If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion, CveSATMotivoCancelacion:=CveSATMotivoCancelacion) Then If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 654746115..66ef491bf 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -611,7 +611,7 @@ Partial Class Bancos_PopIECompras If UsuarioActual.Empresa.UsaAC Then RegistraScript("if (confirm('La factura está cancelada ante el SAT., ¿Desea eliminar la compra?')) { $get('BtnEliminarCompra').click();}") Else - Alert("La factura está cancelada ante el SAT.") + Alert("La factura está cancelada ante el SAT.", TipoMensaje.MsgError) End If Else @@ -624,47 +624,45 @@ Partial Class Bancos_PopIECompras Valida.Dispose() Else Validada = True - End If + End If + 'CargaProveedor + CveProveedor = dr("CveProveedor").ToString.ToEntero + HdnCveProveedor.Value = CveProveedor.ToString + CargaProveedor(CveProveedor, "-1") + CveMoneda = dr("CveMoneda").ToString.ToEntero + CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero + CveMonedaCompra = dr("CveMoneda").ToString.ToEntero + CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero + SerieFolio = dr("SerieFolio").ToString + TipoCambioOriginal = dr("TipoCambioOriginal").ToString.ToDecimal + NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor)) + CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero + LtlTitulo.Text = "Cuentas por Pagar" + LtlTipo2.Text = "Folio" + LtlTipo3.Text = "Fecha" + LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() + LtlFolio.Text = dr("SerieFolio").ToString + LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") + + 'Configuración de Modalidad Update + MovimientoPagar = New IEMovimiento + MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal + MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal + MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal.RoundSQL + MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal.RoundSQL + MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal + MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal + MovimientoPagar.Total = dr("Total").ToString.ToDecimal + MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal + MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal + MovimientoPagar.ConceptoRetIVA = dr("CveRetIVAConcepto").ToString.ToEntero + MovimientoPagar.ConceptoRetISR = dr("CveRetISRConcepto").ToString.ToEntero + MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal + MovimientoPagar.IVAPorPagar = dr("IVAPorPagar").ToString.ToDecimal + If Validada Then - 'CargaProveedor - CveProveedor = dr("CveProveedor").ToString.ToEntero - HdnCveProveedor.Value = CveProveedor.ToString - CargaProveedor(CveProveedor, "-1") - CveMoneda = dr("CveMoneda").ToString.ToEntero - CveTipoConcepto = dr("CveTipoConcepto").ToString.ToEntero - CveMonedaCompra = dr("CveMoneda").ToString.ToEntero - CveMonedaFiltros = dr("CveMoneda").ToString.ToEntero - SerieFolio = dr("SerieFolio").ToString - TipoCambioOriginal = dr("TipoCambioOriginal").ToString.ToDecimal - NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor)) - - CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero - - LtlTitulo.Text = "Cuentas por Pagar" - LtlTipo2.Text = "Folio de la Compra" - LtlTipo3.Text = "Fecha de la Compra" - LtlFechaVenta.Text = dr("Fecha").ToString.ToDate.ToShortDateString() - LtlFolio.Text = dr("SerieFolio").ToString - LtlSaldo.Text = If(CveMoneda = 1, $"{dr("Saldo").ToString.FormatoNumero}{" MXN"}", $"{dr("Saldo").ToString.FormatoNumero}{" USD"}") - - 'Configuración de Modalidad Update - MovimientoPagar = New IEMovimiento - MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal - MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal - MovimientoPagar.IVADeducible = dr("IVADeducible").ToString.ToDecimal.RoundSQL - MovimientoPagar.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal.RoundSQL - MovimientoPagar.RetIVA = dr("RetIVA").ToString.ToDecimal - MovimientoPagar.RetISR = dr("RetISR").ToString.ToDecimal - MovimientoPagar.Total = dr("Total").ToString.ToDecimal - MovimientoPagar.Saldo = dr("Saldo").ToString.ToDecimal - MovimientoPagar.IEPS = dr("IEPS").ToString.ToDecimal - MovimientoPagar.ConceptoRetIVA = dr("CveRetIVAConcepto").ToString.ToEntero - MovimientoPagar.ConceptoRetISR = dr("CveRetISRConcepto").ToString.ToEntero - MovimientoPagar.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal - MovimientoPagar.IVAPorPagar = dr("IVAPorPagar").ToString.ToDecimal - TxtFolio.Enabled = True TxtFechaDocumento.Enabled = True Calendario.Enabled = True 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/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index 72be2e8c0..9fbf0c80c 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index b58db10e3..db600d989 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -16,6 +16,8 @@ using ADSNetLibrary.SIGAPI.Models.Ventas.Request; using ADSNetLibrary.SIGAPI.Models.Ventas.Response; using MoreLinq; using ADSNetLibrary.SIGAPI.Services; +using ADSNetLibrary.SIGAPI.Services.Encuestas; +using ADSNetLibrary.SIGAPI.Models.Encuestas.Request; public partial class CRM_Acercamiento : ClsPaginas { @@ -1226,23 +1228,41 @@ public partial class CRM_Acercamiento : ClsPaginas #region "TAB DATOS TECNICOS" protected void CargaDatosTecnicos() { - ClsEncuestas objEncuesta = new ClsEncuestas(); - if (objEncuesta.GetRespuestas(CveEncuestaProcesoCRM)) - DTRespuestasDatosTecnicos = objEncuesta.DtResultados; - - if (objEncuesta.GetDatosTecnicosEmpresaCRM(CveEncuestaProcesoCRM, CveEncuestaAplicadaProceso, UsuarioActual.Empresa.CveEmpresa)) + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + var responseGenericGetRespuestas = encuestaService.GetRespuestas(CveEncuestaProcesoCRM); + if (responseGenericGetRespuestas.IsSuccess) { - GvDatosTecnicos.DataSource = objEncuesta.DtResultados; - if (objEncuesta.DtResultados.Rows.Count > 0) + DTRespuestasDatosTecnicos = responseGenericGetRespuestas.Result.ToDataTable(); + } + + var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa, CveEncuesta = CveEncuestaProcesoCRM, CveEncuestaAplicada = CveEncuestaAplicadaProceso, CvePregunta = -1 }); + if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess) + { + GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result; + if (responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0) { - //BtnModalReferenciasVerificar.Visible = true; GvDatosTecnicos.Visible = true; } } - //UpModalReferenciasBtn.Update(); - objEncuesta.Dispose(); + //ClsEncuestas objEncuesta = new ClsEncuestas(); + + //if (objEncuesta.GetRespuestas(CveEncuestaProcesoCRM)) + // DTRespuestasDatosTecnicos = objEncuesta.DtResultados; + + //if (objEncuesta.GetDatosTecnicosEmpresaCRM(CveEncuestaProcesoCRM, CveEncuestaAplicadaProceso, UsuarioActual.Empresa.CveEmpresa)) + //{ + // GvDatosTecnicos.DataSource = objEncuesta.DtResultados; + // if (objEncuesta.DtResultados.Rows.Count > 0) + // { + // //BtnModalReferenciasVerificar.Visible = true; + // GvDatosTecnicos.Visible = true; + // } + //} + + ////UpModalReferenciasBtn.Update(); + //objEncuesta.Dispose(); GvDatosTecnicos.DataBind(); UpDatosTecnicos.Update(); @@ -1364,14 +1384,20 @@ public partial class CRM_Acercamiento : ClsPaginas int CveEncuestaAplicadaDetalle = -1; Boolean ExisteRegistro = true; DataTable dtRespuesta; + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); //NUEVA CAPTURA DE DATOS TECNICOS if (_CveEncuestaAplicada == -1) { - if (ObjDatosTecnicos.AddEncuestaAplicada(CveEncuestaProcesoCRM, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + var responseModelAddEncuestaAplicada = encuestaService.AddEncuestaAplicada(new RequestEncuestaAplicadaAdd() { CveEncuesta = CveEncuestaProcesoCRM, CveCliente = -1, CvePersonal = -1, CveUsuario = UsuarioActual.CveUsuario, CveEmpresa = UsuarioActual.CveEmpresa }); + if (responseModelAddEncuestaAplicada.Result > 0) { - _CveEncuestaAplicada = ObjDatosTecnicos.DtResultados.Rows[0][0].ToEntero(); + _CveEncuestaAplicada = responseModelAddEncuestaAplicada.Result.ToEntero(); } + // if (ObjDatosTecnicos.AddEncuestaAplicada(CveEncuestaProcesoCRM, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + //{ + // _CveEncuestaAplicada = ObjDatosTecnicos.DtResultados.Rows[0][0].ToEntero(); + //} } foreach (GridViewRow drow in GvDatosTecnicos.Rows) @@ -1437,17 +1463,31 @@ public partial class CRM_Acercamiento : 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; } + + ////ACTUALIZAMOS LOS DATOS TECNICOS + //if (ExisteRegistro && !(ObjDatosTecnicos.UpdateDatosTecnicosCRM(CveEncuestaAplicadaDetalle, CveEncuestaAplicada, CvePregunta, CveRespuesta, Respuesta))) + //{ + // //SI HAY ERROR REGRESA 0 + // _CveEncuestaAplicada = 0; + //} + //else if (!ExisteRegistro && !(ObjDatosTecnicos.AddEncuestaAplicadaDetalle(_CveEncuestaAplicada, CvePregunta, CveRespuesta, Respuesta))) + //{ + // //SI HAY ERROR REGRESA 0 + // _CveEncuestaAplicada = 0; + //} dtRespuesta.Dispose(); } // SI REGRESA _CveEncuestaAplicada = 0 HUBO ERROR diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs index 5728ac656..5b0d23fcb 100644 --- a/CRM/EmpresaCRM.aspx.cs +++ b/CRM/EmpresaCRM.aspx.cs @@ -14,6 +14,8 @@ 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 { @@ -451,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) { @@ -520,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; @@ -600,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; @@ -827,6 +834,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas var objAcercamiento = cRMService.GetAceracamientoCRM(aceramientoGet); ClsEncuestas objDatosTecnicos = new ClsEncuestas(ObjCRM.IniciaTransacSQL()); + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + if (objAcercamiento.Result.Count == 0) { @@ -835,7 +844,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (cRMService.EmpresasCRMDelete(EmpresasCRM)) { HuboError = false; - if (CveEncuestaAplicada > 0 && !objDatosTecnicos.RemoveEncuestaAplicada(CveEncuestaAplicada, UsuarioActual.CveEmpresa)) + var responseModelRemoveEncuestaAplicada = encuestaService.RemoveEncuestaAplicada(new RequestEncuestaAplicadaRemove() { CveEmpresa = UsuarioActual.CveEmpresa, CveEncuestaAplicada = CveEncuestaAplicada }); + if (CveEncuestaAplicada > 0 && !responseModelRemoveEncuestaAplicada.IsSuccess) { HuboError = true; } @@ -883,8 +893,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas } else { - BtnAgregarContacto.Visible = true; - DivBuscadorContactos.Visible = true; + BtnAgregarContacto.Visible = false; + DivBuscadorContactos.Visible = false; } } @@ -1315,23 +1325,40 @@ public partial class CRM_EmpresaCRM : ClsPaginas #region "CARGAR DATOS TECNICOS - ENCUESTA" protected void CargaDatosTecnicos() { - ClsEncuestas objEncuesta = new ClsEncuestas(); - - if (objEncuesta.GetRespuestas(CveEncuestaCRM)) - DTRespuestasDatosTecnicos = objEncuesta.DtResultados; - - if (objEncuesta.GetDatosTecnicosEmpresaCRM(CveEncuestaCRM, CveEncuestaAplicada, UsuarioActual.Empresa.CveEmpresa)) + var encuestaService = new EncuestaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString); + var responseGenericGetRespuestas = encuestaService.GetRespuestas(CveEncuestaCRM); + if (responseGenericGetRespuestas.IsSuccess) { - GvDatosTecnicos.DataSource = objEncuesta.DtResultados; - if (objEncuesta.DtResultados.Rows.Count > 0) + DTRespuestasDatosTecnicos = responseGenericGetRespuestas.Result.ToDataTable(); + } + + var responseGenericGetDatosTecnicosEmpresaCRM = encuestaService.GetDatosTecnicosEmpresaCRM(new RequestDatosTecnicosEmpresaCRMGet() { CveEmpresa = UsuarioActual.Empresa.CveEmpresa , CveEncuesta = CveEncuestaCRM, CveEncuestaAplicada = CveEncuestaAplicada, CvePregunta = -1}); + if (responseGenericGetDatosTecnicosEmpresaCRM.IsSuccess) + { + GvDatosTecnicos.DataSource = responseGenericGetDatosTecnicosEmpresaCRM.Result; + if(responseGenericGetDatosTecnicosEmpresaCRM.Result.Count > 0) { - //BtnModalReferenciasVerificar.Visible = true; GvDatosTecnicos.Visible = true; } } - //UpModalReferenciasBtn.Update(); - objEncuesta.Dispose(); + //ClsEncuestas objEncuesta = new ClsEncuestas(); + + //if (objEncuesta.GetRespuestas(CveEncuestaCRM)) + // DTRespuestasDatosTecnicos = objEncuesta.DtResultados; + + //if (objEncuesta.GetDatosTecnicosEmpresaCRM(CveEncuestaCRM, CveEncuestaAplicada, UsuarioActual.Empresa.CveEmpresa)) + //{ + // GvDatosTecnicos.DataSource = objEncuesta.DtResultados; + // if (objEncuesta.DtResultados.Rows.Count > 0) + // { + // //BtnModalReferenciasVerificar.Visible = true; + // GvDatosTecnicos.Visible = true; + // } + //} + + ////UpModalReferenciasBtn.Update(); + //objEncuesta.Dispose(); GvDatosTecnicos.DataBind(); UpDatosTecnicos.Update(); @@ -1564,7 +1591,6 @@ 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); - AcercaminetoModel AcercamientoModel = new AcercaminetoModel(); @@ -1601,24 +1627,29 @@ public partial class CRM_EmpresaCRM : ClsPaginas if (tempDT.Rows.Count > 0) { - AcercamientoModel.CveEmpresaCRM = CveEmpresaCRM; - AcercamientoModel.CveContactoPrincipal = CveContactoPrincipal; - AcercamientoModel.CveTipoProceso = CveTipoProceso; - AcercamientoModel.CveEtapaProcesoActual = CveEtapaProcesoActual; - AcercamientoModel.CveVendedor = CveVendedor; - AcercamientoModel.CveMedioCaptacion = CveMedioCaptacion; - AcercamientoModel.CveRechazoMotivo = CveRechazoMotivo; - AcercamientoModel.CveProbabilidadAcercamiento = CveProbabilidadAcercamiento; - AcercamientoModel.FechaApertura = FechaApertura; - AcercamientoModel.FechaCierre = (DateTime)System.Data.SqlTypes.SqlDateTime.Null; - AcercamientoModel.NombreAcercamiento = NombreAcercamiento; - AcercamientoModel.Descripcion = Descripcion; - AcercamientoModel.Importe = Importe; - AcercamientoModel.Comision = Comision; - AcercamientoModel.Prioridad = Prioridad; - AcercamientoModel.CveEmpresa = UsuarioActual.CveEmpresa; - AcercamientoModel.CveUsuarioIng = CveUsuarioIng; - AcercamientoModel.CvePS = DdlPS.SelectedValue.ToEntero(); + 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(); } 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 bbeb59cd2..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()) @@ -216,6 +217,16 @@ Partial Class PopUpVerFactura 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" @@ -227,13 +238,34 @@ Partial Class PopUpVerFactura 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 = row("Fecha").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)) @@ -241,9 +273,18 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("SubProyecto", SubProyecto)) params.Add(New ReportParameter("AgenciaAduanalUSA", AgenciaAduanalUSA)) params.Add(New ReportParameter("AgenciaAduanalMEX", AgenciaAduanalMEX)) - params.Add(New ReportParameter("Temperatura", "45")) + 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)) @@ -1609,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/RepCxP.aspx.vb b/Compras/RepCxP.aspx.vb index 8ebbfe1d9..20d4ef2de 100644 --- a/Compras/RepCxP.aspx.vb +++ b/Compras/RepCxP.aspx.vb @@ -500,6 +500,8 @@ Partial Class Compras_RepCxP If e.Row.RowType = DataControlRowType.DataRow Then Dim Css As String = "Texto" + Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM) + If chkAgruparMes.Checked Then Dim TipoMoneda As Integer = RblTipoCambio.SelectedValue.ToEntero ' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero @@ -509,6 +511,7 @@ Partial Class Compras_RepCxP 'Dim CveProveedorSucursal As Integer = If(e.Row.DBCampo("CveProveedorSucursal").ToEntero > 0, e.Row.DBCampo("CveProveedorSucursal").ToEntero, -1) Dim FechaI, FechaF, FechaVI, FechaVF As String + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1") @@ -548,50 +551,50 @@ Partial Class Compras_RepCxP e.Row.FCHyperLink($"HplColumna14").Text = e.Row.DBCampo("Mes12").ToString.FormatoNumero e.Row.FCHyperLink($"HplColumna15").Text = e.Row.DBCampo("Mes13").ToString.FormatoNumero - Dim Liga1 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga1 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna1").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna2").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes1"), e.Row.DBCampo("NomMesF1"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes1"), e.Row.DBCampo("NomMesF1"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna3").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes2"), e.Row.DBCampo("NomMesF2"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes2"), e.Row.DBCampo("NomMesF2"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna4").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes3"), e.Row.DBCampo("NomMesF3"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes3"), e.Row.DBCampo("NomMesF3"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna5").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes4"), e.Row.DBCampo("NomMesF4"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes4"), e.Row.DBCampo("NomMesF4"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna6").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes5"), e.Row.DBCampo("NomMesF5"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes5"), e.Row.DBCampo("NomMesF5"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna7").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes6"), e.Row.DBCampo("NomMesF6"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes6"), e.Row.DBCampo("NomMesF6"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna8").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes7"), e.Row.DBCampo("NomMesF7"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes7"), e.Row.DBCampo("NomMesF7"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna9").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes8"), e.Row.DBCampo("NomMesF8"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes8"), e.Row.DBCampo("NomMesF8"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna10").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes9"), e.Row.DBCampo("NomMesF9"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes9"), e.Row.DBCampo("NomMesF9"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna11").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes10"), e.Row.DBCampo("NomMesF10"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes10"), e.Row.DBCampo("NomMesF10"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna12").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes11"), e.Row.DBCampo("NomMesF11"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes11"), e.Row.DBCampo("NomMesF11"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna13").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes12"), e.Row.DBCampo("NomMesF12"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes12"), e.Row.DBCampo("NomMesF12"), TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna14").NavigateUrl = Liga1 - Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes13"), "31/12/9999", TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Liga1 = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, e.Row.DBCampo("NomMes13"), "31/12/9999", TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) e.Row.FCHyperLink($"HplColumna15").NavigateUrl = Liga1 If e.Row.FCHyperLink("HplSaldo").Text = "0.00" Then e.Row.FCHyperLink("HplSaldo").Text = "-" @@ -654,52 +657,52 @@ Partial Class Compras_RepCxP '/Bancos/RepProgramarRecursos.aspx --> Compras/RepCxPDetalle.aspx - Dim LigaTot As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim LigaTot As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga1 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga1 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C1&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga2 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga2 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C2&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga3 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga3 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C3&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga4 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga4 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C4&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga5 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga5 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C5&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga6 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga6 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C6&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga7 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga7 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C7&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga8 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) - Dim Liga9 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C9&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) - Dim Liga10 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C10&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) - Dim Liga11 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C11&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) - Dim Liga12 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C12&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) - Dim Liga13 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C13&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga8 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C8&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) + Dim Liga9 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C9&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) + Dim Liga10 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C10&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) + Dim Liga11 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C11&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) + Dim Liga12 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C12&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) + Dim Liga13 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=C13&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga14 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga14 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=S&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga15 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga15 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=TV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) - Dim Liga16 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}", - e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones")) + Dim Liga16 As String = String.Format("/Compras/RepCxPDetalle.aspx?Op=TPV&GPO={0}&Anio={1}&Mes={2}&AnioMes={3}&Fecha={4}&CveProveedor={5}&CveUsuario={6}&CveMoneda={7}&FechaI={8}&FechaF={9}&CveProveedorSucursal={10}&CveProveedorClasificacion={11}&CveSubProyecto={12}&CveEstatusFactura={13}&TipoMoneda={14}&CveUsuarioResponsable={15}&FechaVI={16}&FechaVF={17}&TCEspecifico={18}&FechaCorte={19}&CveTipoProveedor={20}&Comprobaciones={21}&TipoDocto={22}", + e.Row.DBCampo("CveGpo"), e.Row.DBCampo("Anio"), e.Row.DBCampo("Mes"), e.Row.DBCampo("AnioMes"), e.Row.DBCampo("Fecha"), e.Row.DBCampo("CveProveedor"), e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveMoneda"), FechaI, FechaF, e.Row.DBCampo("CveProveedorSucursal"), e.Row.DBCampo("CveProveedorClasificacion"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveEstatusFactura"), TipoMoneda, Responsable, FechaVI, FechaVF, TCEspecifico, txtCorteA.Text, CveTipoProveedor, e.Row.DBCampo("Comprobaciones"), TipoDocto) diff --git a/Compras/RepCxPDetalle.aspx.vb b/Compras/RepCxPDetalle.aspx.vb index 02d03676d..b76ed4db7 100644 --- a/Compras/RepCxPDetalle.aspx.vb +++ b/Compras/RepCxPDetalle.aspx.vb @@ -371,15 +371,17 @@ Partial Class RepCxPDetalle FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") FechaVI = If(IsDate(txtFechaVI.Text.Trim()), txtFechaVI.Text.Trim(), "-1") - FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1") - + FechaVF = If(IsDate(txtFechaVF.Text.Trim()), txtFechaVF.Text.Trim(), "-1") + + Dim TipoDocto As String = IfNull(Request("TipoDocto"), "-1").ToString + CveTipoProveedor = DdlTipoProveedor.SelectedValue.ToEntero If ObjMovtos.GetCxPDetalle(FechaI, FechaF, DdlProveedores.SelectedValue.ToEntero, DdlProveedoresClasificaciones.SelectedValue.ToEntero, CveProveedorSucursal, CveUsuario, DdlUsuarioResponsable.SelectedValue.ToEntero, Anio, Mes, AnioMes, CveMoneda, CveSubProyecto, DdlEstatusCompra.SelectedValue.ToEntero, Fecha, DdlGrupo.SelectedValue.ToEntero, Opcion, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, FechaVI, FechaVF, FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=IIf(CveTipoProveedor = 3, - -1, CveTipoProveedor), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero, AplicaNC:=DdlAplicaNC.SelectedValue.ToEntero()) Then + -1, CveTipoProveedor), Comprobaciones:=DdlComprobacion.SelectedValue.ToEntero, AplicaNC:=DdlAplicaNC.SelectedValue.ToEntero(), TipoDocto:=TipoDocto) Then Dim TMP_DTDatos As New DataTable diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index f3e2ed114..a1d01875f 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1063,7 +1063,7 @@ Partial Class Compras_eFacturas e.Row.FCHyperLink("HplProveedor").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor")) - If e.Row.DBCampo("CveCompra") = "" AndAlso (e.Row.DBCampo("FueValidado") = "1") Then ' OrElse UsuarioActual.CveEmpresa = 66 + If e.Row.DBCampo("CveCompra") = "" AndAlso (e.Row.DBCampo("FueValidado") = "1" OrElse UsuarioActual.Empresa.Funcionalidad(529) = "1") Then ' OrElse UsuarioActual.CveEmpresa = 66 If e.Row.DBCampo("TipoComprobante") = "P" Then e.Row.FCHyperLink("HplAgregar").Visible = False diff --git a/GPS/EmbarqueManifiesto.rdlc b/GPS/EmbarqueManifiesto.rdlc index ce19a6260..9a570754e 100644 --- a/GPS/EmbarqueManifiesto.rdlc +++ b/GPS/EmbarqueManifiesto.rdlc @@ -303,7 +303,7 @@ - 06:44:07 p. m. + =Parameters!Hora.Value @@ -506,7 +506,7 @@ - Textbox496 + Textbox4 @@ -614,14 +614,14 @@ - + true true - 18,172.00 + =Parameters!NoKgManifiesto.Value @@ -632,7 +632,7 @@ - Textbox499 + Textbox8 @@ -874,14 +874,14 @@ - + true true - 20 + =Parameters!NoPallets.Value @@ -892,7 +892,7 @@ - Textbox508 + Textbox6 @@ -2768,7 +2768,7 @@ - + =Parameters!Chofer.Value @@ -3188,7 +3188,13 @@ - 45 °F + =Parameters!Temperatura.Value + + + + °F @@ -3327,7 +3333,7 @@ - + =Parameters!CamPlaca.Value @@ -3389,7 +3395,7 @@ - + =Parameters!Camion.Value @@ -3475,14 +3481,14 @@ - + true true - LCT-03 + =Parameters!Remolque1.Value @@ -3493,7 +3499,7 @@ - Textbox157 + Textbox9 @@ -3541,14 +3547,14 @@ - + true true - 67-UA-1Z + =Parameters!Rem1Placa.Value @@ -3559,7 +3565,7 @@ - Textbox222 + Textbox10 @@ -5364,7 +5370,7 @@ - =Parameters!AgenciaAduanalUSA.Value + =Parameters!AgenciaAduanalMEX.Value @@ -5470,7 +5476,7 @@ - =Parameters!AgenciaAduanalMEX.Value + =Parameters!AgenciaAduanalUSA.Value @@ -7167,21 +7173,21 @@ - + true true - + =Fields!NoPallets.Value + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + true + true + + + + + =Fields!Etiqueta.Value + - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - 1 1/9 GROWER - - + Calculo ISR anual - + - +
  • - Excel + Excel
  • -
    - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
  • + Autoriza +
  • +
    +
    +
    + + + + + + + +
    +
    +
    +
    + +
    + +
    +
    + + +
    + +
    +
    +
    + <%----%> +
    +
    + +
    +
    +
    + + + +
    +
    +
    + + Calculo anual + +
    + +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + <%# Eval("Aplica").ToString() =="1" ?"✓" :"✘" %> + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + Ingresos
    totales
    +
    + + + +
    + + + Base
    gravada
    +
    + + + +
    + + + Base
    exenta
    +
    + + + +
    + + + ISR
    retenido
    +
    + + + +
    + + + Art 152 + + + + + + + + Subs.
    correspondiente
    +
    + + + +
    + + + Impuesto
    anual
    +
    + + + +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + +
    - + diff --git a/Nomina/CalculoISRAnual.aspx.cs b/Nomina/CalculoISRAnual.aspx.cs index 624902bf0..4392add3e 100644 --- a/Nomina/CalculoISRAnual.aspx.cs +++ b/Nomina/CalculoISRAnual.aspx.cs @@ -1,25 +1,57 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using System.Xml.Linq; +using Extensiones; public partial class Nomina_CalculoISRAnual : ClsPaginas { + + protected int CvePersonal + { + get + { + if (ViewState["CvePersonal"] == null) { return 0; } + else { return ViewState["CvePersonal"].ToString().ToEntero(); } + } + + set { ViewState["CvePersonal"] = value; } + } + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { + cargaddls(); CargaCalculoISRAnual(); } } + public void cargaddls() + { + + DataTable dtejercicio = new DataTable(); + using (ClsNominas objnom = new ClsNominas()) + { + if (objnom.GetEjercicios(UsuarioActual.CveEmpresa)) + { + dtejercicio = objnom.DtResultados; + } + } + DdlEjercicios.DataSource = dtejercicio; + DdlEjercicios.DataBind(); + string anio = DateTime.Now.Year.ToString(); + DdlEjercicios.SelectedValueExistInsert(anio, anio); + } protected void CargaCalculoISRAnual() { using (ClsNominas onom = new ClsNominas()) { - onom.CalculoISRAnual(2021, UsuarioActual.Empresa.CveEmpresa); + onom.CalculoISRAnual(DdlEjercicios.SelectedValue.ToEntero(), UsuarioActual.Empresa.CveEmpresa); GVCalculoISRAnual.DataSource = onom.DtResultados; } @@ -27,8 +59,185 @@ public partial class Nomina_CalculoISRAnual : ClsPaginas upDatos.Update(); } + protected void LnkConsultar_Click(object sender, EventArgs e) + { + CargaCalculoISRAnual(); + } protected void LnkdownExcel_Click(object sender, EventArgs e) { + + //DataTable dtCon = generateTable("\r\n"); + + + ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook(); + var libro = wb.AddWorksheet("Asistencia"); + int column = 1; + + int row = 1; + + libro.Cell(row, column++).Value = "Aplica"; + libro.Cell(row, column++).Value = "Causa"; + libro.Cell(row, column++).Value = "Código"; + libro.Cell(row, column++).Value = "Nombre"; + libro.Cell(row, column++).Value = "Tipo ingreso"; + libro.Cell(row, column++).Value = "Ingresos totales"; + libro.Cell(row, column++).Value = "Base gravada"; + libro.Cell(row, column++).Value = "Base exenta"; + libro.Cell(row, column++).Value = "ISR retenido"; + libro.Cell(row, column++).Value = "Art 152"; + libro.Cell(row, column++).Value = "Subs. Correspondiente"; + libro.Cell(row, column++).Value = "Impuesto anual"; + libro.Cell(row, column++).Value = "A cargo"; + libro.Cell(row, column++).Value = "A compensar"; + libro.Range(row, 1, row, column - 1).CellsUsed().Style.Font.FontColor = ClosedXML.Excel.XLColor.White; + libro.Range(row, 1, row, column - 1).CellsUsed().Style.Fill.SetBackgroundColor(ClosedXML.Excel.XLColor.FromArgb(79, 129, 189)); + row++; + using (ClsNominas onom = new ClsNominas()) + { + if (onom.CalculoISRAnual(DdlEjercicios.SelectedValue.ToEntero(), UsuarioActual.Empresa.CveEmpresa) && onom.DtResultados.Rows.Count > 0) + { + foreach (DataRow drow in onom.DtResultados.Rows) + { + + column = 1; + libro.Cell(row, column++).Value = drow["Aplica"].ToString()=="1"?"Si":"No"; + libro.Cell(row, column++).Value = drow["causa"]; + libro.Cell(row, column++).Value = drow["Codigo"]; + libro.Cell(row, column++).Value = drow["NombreCompleto"]; + libro.Cell(row, column++).Value = string.Format("{0} - {1:dd/MM/yyyy}", drow["TipoIngreso"], drow["FechaInicio"]); + libro.Cell(row, column++).Value = drow["IngresosTotales"]; + libro.Cell(row, column++).Value = drow["BaseGravada"]; + libro.Cell(row, column++).Value = drow["BaseExcenta"]; + libro.Cell(row, column++).Value = drow["ISRRetenido"]; + libro.Cell(row, column++).Value = drow["Art152"]; + libro.Cell(row, column++).Value = drow["SubsCorrespondiente"]; + libro.Cell(row, column++).Value = drow["ImpuestoAnual"]; + libro.Cell(row, column++).Value = drow["Acargo"]; + libro.Cell(row, column++).Value = drow["Acompensar"]; + row++; + } + } + } + + libro.SheetView.Freeze(1, 4); + libro.ColumnsUsed().AdjustToContents(); + libro.Range(1, 6, 1, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Center; + libro.Range(2, 6, row, column).Style.Alignment.Horizontal = ClosedXML.Excel.XLAlignmentHorizontalValues.Right; + libro.Range(2, 6, row, column).SetDataType(ClosedXML.Excel.XLDataType.Number); + libro.Range(2, 6, row, column).Style.NumberFormat.Format = "$#,###,###,###,###,###,0.00"; + + + System.IO.Stream fs = new System.IO.MemoryStream(); + wb.SaveAs(fs); + fs.Position = 0; + System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); + using (System.IO.Stream input = fs) + + { + input.CopyTo(memoryStream); + } + memoryStream.Position = 0; + + Response.Clear(); + Response.Buffer = true; + + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xlsx", "Calculo Anual")); + Response.BinaryWrite(memoryStream.ToArray()); + Response.End(); + } + + + protected void LnkAplicar_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CvePersonal = gvrow.DataKey("CvePersonal").ToString().ToEntero(); + using (ClsNominas onom = new ClsNominas()) + { + if (onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CvePersonal, 1, "")) + { + Alert("El empleado sera incluido al calculo anual"); + CargaCalculoISRAnual(); + } + } + } + + protected void LnkCancelar_Click(object sender, EventArgs e) + { + GridViewRow gvrow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CvePersonal = gvrow.DataKey("CvePersonal").ToString().ToEntero(); + RegistraScript("$('#DModalcancelarEmpleado').modal();"); + } + + protected void LnkGuardarCancelarAplica_Click(object sender, EventArgs e) + { + using (ClsNominas onom = new ClsNominas()) + { + if(onom.PersonalAplicaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, CvePersonal, 0, TxtMotivo.Text)) + { + Alert("El empleado sera omitido del calculo anual"); + RegistraScript("$('#DModalcancelarEmpleado').modal('hide');"); + CargaCalculoISRAnual(); + } + } + } + + protected void LnkOpenModalAutoriza_Click(object sender, EventArgs e) + { + using(ClsNominas onom = new ClsNominas()) + { + if (onom.GetConceptos(UsuarioActual.CveEmpresa, "-1", -1, -1, -1)) + { + DdlConceptoCargo.DataSource = onom.DtResultados; + DdlConceptoCompensar.DataSource = onom.DtResultados; + DdlConceptoCargo.DataBind(); + DdlConceptoCompensar.DataBind(); + DataRow drow = onom.DtResultados.FiltroPrimero(string.Format("CveSistema ={0}",46)); + if (drow != null) + { + DdlConceptoCargo.SelectedValueExist(drow["CveConcepto"]); + } + drow = null; drow = onom.DtResultados.FiltroPrimero(string.Format("CveSistema ={0}", 49)); + if (drow != null) + { + DdlConceptoCompensar.SelectedValueExist(drow["CveConcepto"]); + } + } + } + RegistraScript("$('#DModalAutoriza').modal();"); + UpAutorizaCalculo.Update(); + } + + protected void LnkAutoriza_Click(object sender, EventArgs e) + { + bool continuar = true; + + + System.Xml.Linq.XDocument xmlarchivos = new System.Xml.Linq.XDocument(); + XElement xfolder = new XElement("personal"); + foreach (GridViewRow item in GVCalculoISRAnual.Rows ) + { + XElement xempleado = new XElement("empleado"); + xempleado.SetAttributeValue("CvePersonal", item.DataKey("CvePersonal")); + xempleado.SetAttributeValue("ACarago", item.DataKey("Acargo")); + xempleado.SetAttributeValue("ACompensar", item.DataKey("Acompensar")); + + xfolder.Add(xempleado); + } + xmlarchivos.Add(xfolder); + string xmlpeople= xmlarchivos.ToString(); + + using (ClsNominas onom = new ClsNominas()) + { + continuar = onom.AutorizaCalculoAnual(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, xmlpeople); + } + if (continuar) + { + Alert("El calculo a sido autorizado"); + RegistraScript("$('#DModalAutoriza').modal('hide');"); + } + + RegistraScript(string.Format("console.log('{0}');debugger", xmlpeople)); } } \ No newline at end of file diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index 69c9446da..80beff38b 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -2380,7 +2380,6 @@ - @@ -2448,9 +2447,24 @@ +
    +
    +
    + + Anual +
    +
    + + +
    +
    +
    + +
    +
    - + diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 99ac821e1..7029ad299 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -3612,6 +3612,7 @@ public partial class Nomina_Nomina2 : ClsPaginas GVVigISRSemanal.DataSource = objnom.DTSetResultados.Tables[7]; GVVigISRDecenal.DataSource = objnom.DTSetResultados.Tables[8]; GVVigISRQuincenal.DataSource = objnom.DTSetResultados.Tables[9]; + GVVigISRAnual.DataSource = objnom.DTSetResultados.Tables[10]; @@ -3631,6 +3632,7 @@ public partial class Nomina_Nomina2 : ClsPaginas GVVigISRSemanal.DataBind(); GVVigISRDecenal.DataBind(); GVVigISRQuincenal.DataBind(); + GVVigISRAnual.DataBind(); GVUma.DataBind(); UpModalTablas.Update(); } diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index 85844e675..656215346 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -154,7 +154,8 @@ public partial class RH_CalculoSBC : ClsPaginas double SalarioDiarioSSNuevo = Math.Round(item.DataKey("SalarioDiarioSSNuevo").ToDouble(), 2); double SalarioVariableNuevo = item.DataKey("SalarioVariableNuevo").ToDouble(); double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2); - if (continuar && SalarioDiarioSSNuevo != SalarioDiarioSS && (continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario))) + if (continuar && SalarioDiarioSSNuevo != SalarioDiarioSS && + (continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario))) { } diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 04ef776aa..7c143cb75 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -788,7 +788,7 @@ Partial Class Clientes UpAccionesCRM.Update() End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveRol = 1280 Then + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveRol.Contiene(1280, 1511) Then DeshabilitarDatosClienteCajas() End If diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx b/Ventas/RepCancelacionesPorRespuesta.aspx index 5d2d38310..41171b71d 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx +++ b/Ventas/RepCancelacionesPorRespuesta.aspx @@ -67,7 +67,7 @@ - + @@ -104,7 +104,7 @@ @@ -116,9 +116,17 @@ + + + - + + + + + + diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs index f6aba3b50..b8dfdb1f9 100644 --- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs +++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs @@ -41,7 +41,19 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas } var ObjVentas = new ClsVentas(); - if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -2, -1, "-1", "-1", "-1", CveUsuarioConsulta: UsuarioActual.CveUsuario)) + //if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", -1, "-1", -1, -1, -2, -1, "-1", "-1", "-1", CveUsuarioConsulta: UsuarioActual.CveUsuario)) + //{ + + // if (Request["CveVenta"] != null && Request["CveVenta"].ToString().ToEntero() > 0) + // { + // DtVentas = ObjVentas.DtResultados.FiltraParametros($"CveVenta={Request["CveVenta"].ToString().ToEntero()}"); + // } + // else + // { + // DtVentas = ObjVentas.DtResultados.Copy(); + // } + //} + if (ObjVentas.GetVentasPendientesCancelacion(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario)) { if (Request["CveVenta"] != null && Request["CveVenta"].ToString().ToEntero() > 0) @@ -89,13 +101,13 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas var resp = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total); if (resp.EnviarAcuse) { - Alert(resp.Mensaje,TipoMensaje.MsgConfirmacion,"BtnEnviarMailCancelacion();",TextoConfirmacion:"Enviar",TextoSegundoBoton:"Cancelar"); + Alert(resp.Mensaje, TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar"); } else { Alert(resp.Mensaje); } - + } CargaDatos(); } @@ -115,22 +127,22 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas string Folio = GvRow.DataKey("Folio"); string TipoDocto = GvRow.DataKey("TipoDocto"); string Nombre = GvRow.DataKey("Nombre"); - + string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion"); if (CveVenta > 0 && Uuid != "") { - var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true); + var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCCliente, Total, true, FolioSustitucion); CargaDatos(); - if (respuesta.CveEstatus.Contiene(4,5)) + if (respuesta.CveEstatus.Contiene(4, 5)) { HdnLigaRefacturar.Value = respuesta.LigaRefacturacion; Alert(respuesta.Mensaje, JSBtnAceptar: $"RefacturarDocumento();"); } else { - Alert(respuesta.Mensaje,TipoMensaje.MsgAdvertencia); + Alert(respuesta.Mensaje, TipoMensaje.MsgAdvertencia); } - + //if (respuesta.IrARefacturar) //{ // Server.Transfer(respuesta.LigaRefacturacion); @@ -142,9 +154,78 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas //} } UPDatos.Update(); - + } - private MRespuestaSAT VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false) + + protected void BtnCancelarDocumento_Click(object sender, EventArgs e) + { + this.HdnLigaRefacturar.Value = ""; + this.CveVenta = -1; + + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + this.CveVenta = GvRow.DataKey("CveVenta").ToEntero(); + + int CveCliente = GvRow.DataKey("CveCliente").ToEntero(); + string Total = GvRow.DataKey("Total"); + string SubTotal = GvRow.DataKey("SubTotal"); + string Uuid = GvRow.DataKey("FolioFiscal"); + string RFCCliente = GvRow.DataKey("RFCCliente"); + string Folio = GvRow.DataKey("Folio"); + string TipoDocto = GvRow.DataKey("TipoDocto"); + string Nombre = GvRow.DataKey("Nombre"); + string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion"); + + if (CveVenta > 0 && Uuid != "") + { + var respCancelacion = CancelarDocumento(CveVenta, -1, CveCliente, Folio, Uuid, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusRefacturacion: 2); + + if (!respCancelacion.HuboError) + { + var sb = new StringBuilder(); + var EnviarAcuse = false; + if (respCancelacion.CveEstatus > 0) + { + EnviarAcuse = true; + var CveEstatus = respCancelacion.CveEstatus; + var ObjVentas = new ClsVentas(); + if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa)) + { + sb.Append("El estatus de la factura fue cambiado a 'Cancelada'."); + } + else + { + sb.Append("Ocurrió un error al cambiar el estatus de la factura."); + } + ObjVentas.Dispose(); + sb.Append("El documento se canceló correctamente."); + sb.Append($"
    Imprimir Acuse"); + sb.Append("

    ¿Desea enviar el Acuse de Cancelación al Cliente?"); + } + else + { + sb.Append(respCancelacion.Mensaje); + } + + if (EnviarAcuse) + { + Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar"); + } + else + { + Alert(sb.ToString()); + } + } + else + { + Alert(respCancelacion.Mensaje, TipoMensaje.MsgError); + } + + CargaDatos(); + } + UPDatos.Update(); + + } + private MRespuestaSAT VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false, string FolioSustitucion = "") { HdnLigaRefacturar.Value = ""; @@ -183,20 +264,20 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas if (!UsuarioActual.Empresa.FacturaProduccion && (string.IsNullOrEmpty(uuid) || uuid.Contains("test"))) { - var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion); + var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion); //sb.AppendFormat("{0}
    ", respCancelacion.Mensaje); if (!respCancelacion.HuboError) { CveEstatus = respCancelacion.CveEstatus; retorno.EnviarAcuse = true; - + sb.Append("El documento se canceló correctamente."); sb.Append($"
    Imprimir Acuse"); if (!EsRefacturacion) { sb.Append("

    ¿Desea enviar el Acuse de Cancelación al Cliente?"); - } + } } if (respCancelacion.CveEstatus.Contiene(4, 5) && EsRefacturacion) @@ -218,7 +299,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas { CveEstatus = 5; - var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion); + var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion); //sb.AppendFormat("{0}
    ", respCancelacion.Mensaje); if (!respCancelacion.HuboError) @@ -308,13 +389,17 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas retorno.Mensaje = sb.ToString(); return retorno; } - private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false) + private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusRefacturacion = -1) { Modelos.Factura.MCancelacionVentaMensaje retorno = null; - var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:true); + var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion: true); if (EsRefacturacion) { - retorno = factura.CancelarPorRefacturacion(); + if (CveEstatusRefacturacion > 0) + { + factura.CveEstatusRefacturacion = CveEstatusRefacturacion; + } + retorno = factura.CancelarPorRefacturacion(factura.CveMotivoCancelacion, factura.MotivoCancelacion, FolioSustitucion: FolioSustitucion); } else { @@ -323,7 +408,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas return retorno; } - + private string DecodeBase64(string strXMLCodificado) { try @@ -372,7 +457,18 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas { if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0) { - e.Row.Cells[10].Text = ""; + e.Row.Cells[14].Text = ""; + } + + if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 1 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23) + { + e.Row.FCLinkButton("LnkValidarRefac").Visible = false; + } + + if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0) + { + e.Row.FCLinkButton("LnkCancelar").Visible = true; + e.Row.FCLinkButton("LnkValidarRefac").Visible = false; } } } @@ -419,7 +515,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas byte[] ObjetoPDF = StreamPDF(@"Empresas\Grales\Formatos\AcuseCancelacion.rdlc", DtDatos, parametros, "AcuseCancelacion" + CveVenta); - + List LSRutasMail = new List(); string Asunto = string.Empty; string Cuerpo = string.Empty; @@ -485,11 +581,11 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas } else { - Alert("El acuse de cancelación no pudo ser enviado.",TipoMensaje.MsgError); + Alert("El acuse de cancelación no pudo ser enviado.", TipoMensaje.MsgError); } } - + } } public class MRespuestaSAT diff --git a/Ventas/RepRemisiones.aspx b/Ventas/RepRemisiones.aspx index ab2a17b23..ead8b63ad 100644 --- a/Ventas/RepRemisiones.aspx +++ b/Ventas/RepRemisiones.aspx @@ -296,6 +296,15 @@ <%----%>
    + + + + + + + <%----%> + + diff --git a/Ventas/RepRemisiones.aspx.vb b/Ventas/RepRemisiones.aspx.vb index 6325b7acc..2d67f4de7 100644 --- a/Ventas/RepRemisiones.aspx.vb +++ b/Ventas/RepRemisiones.aspx.vb @@ -91,11 +91,16 @@ Partial Class RepRemisiones Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString Dim ObjVentas As New ClsVentas - If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then - GvDatos.DataSource = ObjVentas.DtResultados - DtVentas = ObjVentas.DtResultados + If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=UsuarioActual.TienePermisoProceso(201)) Then + DtVentas = ObjVentas.DtResultados.Copy() + GvDatos.DataSource = DtVentas End If - GvDatos.Columns(7).Visible = ObjVentas.DtResultados.SUMD("Descuento") > 0 + + If DtVentas IsNot Nothing Then + GvDatos.Columns(7).Visible = DtVentas.SUMD("Descuento") > 0 + End If + + GvDatos.Columns(10).Visible = UsuarioActual.TienePermisoProceso(201) ObjVentas.Dispose() GvDatos.DataBind() diff --git a/Ventas/RepRemisionesDetalle.aspx b/Ventas/RepRemisionesDetalle.aspx index 88a19d02a..5710c6555 100644 --- a/Ventas/RepRemisionesDetalle.aspx +++ b/Ventas/RepRemisionesDetalle.aspx @@ -210,6 +210,15 @@ + + + + + + + <%----%> + + diff --git a/Ventas/RepRemisionesDetalle.aspx.vb b/Ventas/RepRemisionesDetalle.aspx.vb index 98a8e5d23..9863874e9 100644 --- a/Ventas/RepRemisionesDetalle.aspx.vb +++ b/Ventas/RepRemisionesDetalle.aspx.vb @@ -158,7 +158,7 @@ Partial Class RepRemisionesDetalle CveContrato = If(DdlContrato.SelectedValue.ToEntero > 0, DdlContrato.SelectedValue.ToEntero, -1) CveSubProyecto = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString - If ObjVentas.GetRepRemisionesSinFacturarDetalle(FechaI, FechaF, FechaV, CveCliente, CveContrato, CveVenta, UsuarioActual.CveEmpresa, CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + If ObjVentas.GetRepRemisionesSinFacturarDetalle(FechaI, FechaF, FechaV, CveCliente, CveContrato, CveVenta, UsuarioActual.CveEmpresa, CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=UsuarioActual.TienePermisoProceso(201)) Then If CveMoneda = 1 Or CveMoneda = 2 Then DtVentas = ObjVentas.DtResultados.FiltraParametros($"CveMoneda = {CveMoneda}") Else @@ -169,6 +169,8 @@ Partial Class RepRemisionesDetalle ObjVentas.Dispose() GvDatos.DataBind() + GvDatos.Columns(8).Visible = UsuarioActual.TienePermisoProceso(201) + UPDatos.Update() End Sub Public Sub CargaCombos() diff --git a/Ventas/RepVentasUtilidad.aspx b/Ventas/RepVentasUtilidad.aspx index fe815a36f..1f1d3c39f 100644 --- a/Ventas/RepVentasUtilidad.aspx +++ b/Ventas/RepVentasUtilidad.aspx @@ -177,6 +177,10 @@ --%> +
    Categoría
    +
    + +
    Clasificación:
    diff --git a/Ventas/RepVentasUtilidad.aspx.vb b/Ventas/RepVentasUtilidad.aspx.vb index 966302f92..57b725bae 100644 --- a/Ventas/RepVentasUtilidad.aspx.vb +++ b/Ventas/RepVentasUtilidad.aspx.vb @@ -38,7 +38,7 @@ Partial Class Ventas_RepVentasUtilidad txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString 'Carga Clientes - Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False) + Dim EsWS As Boolean = True If EsWS Then DdlClientes.setEsWebService(True) DdlClientes.SelectedValue = "-1" @@ -63,6 +63,11 @@ Partial Class Ventas_RepVentasUtilidad DdlVendedor.Enabled = False End If + 'Cargo categorias + DdlCategoria.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) + DdlCategoria.DataBind() + + 'Cargo Clasificaciones DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() @@ -133,6 +138,14 @@ Partial Class Ventas_RepVentasUtilidad txtFechaF.Text = CveGpo End Select End Sub + + + Protected Sub DdlCategoria_SelectedIndexChanged(sender As Object, e As EventArgs) + DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveCategoria:=DdlCategoria.SelectedValue.ToEntero) + DdlClasificacion.DataBind() + DdlClasificacion.Items.Insert(0, New ListItem("Todas", "-1")) + End Sub + #End Region #Region " CARGA DATOS " @@ -151,7 +164,7 @@ Partial Class Ventas_RepVentasUtilidad Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString - If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then + If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then DtVentas = ObjVentas.DtResultados GvDatos.DataSource = ObjVentas.DtResultados GvDatos.DataBind() @@ -302,7 +315,7 @@ Partial Class Ventas_RepVentasUtilidad Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString - If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then + If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then Dim FechaInicio As String = txtFechaI.Text Dim FechaFin As String = txtFechaF.Text diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx index 63723e3ea..9c211461f 100644 --- a/Ventas/RepVentasUtilidadPadre.aspx +++ b/Ventas/RepVentasUtilidadPadre.aspx @@ -79,24 +79,16 @@
    -
    Grupo:
    -
    - - - - - - - - - - - -
    +
    + Sucursal: +
    +
    + +
    Fecha Inicio:
    -
    +
    @@ -113,7 +105,7 @@
    Fecha Fin:
    -
    +
    @@ -127,17 +119,27 @@
    + +
    Grupo:
    +
    + + + + + + + + + + + +