diff --git a/Acarreos/CatChoferes.aspx.vb b/Acarreos/CatChoferes.aspx.vb index b19289490..9cb694e84 100644 --- a/Acarreos/CatChoferes.aspx.vb +++ b/Acarreos/CatChoferes.aspx.vb @@ -14,7 +14,6 @@ Partial Class Acarreos_CatChoferes CargaDatos() CargaDdlTransportista() - Dim DT As DataTable = GlobalDTColonia(-1) CargaDdls() @@ -23,14 +22,10 @@ Partial Class Acarreos_CatChoferes Private Sub CargaDdls() - - - - DdlEstado.DataSource = GlobalDTEstado(-1).FiltraParametros("ClaveSATPais = 'MEX'") + DdlEstado.DataSource = GlobalDTGralEstados("MEX") DdlEstado.DataBind() DdlEstado.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - DdlMunicipio.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Una", "-1")) DdlColonia.Items.Insert(0, New ListItem("Seleccione Una", "-1")) @@ -82,11 +77,13 @@ Partial Class Acarreos_CatChoferes If ObjAcar.AddChofer(TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then CargaDatos() Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) + GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing End If ElseIf HdnModalidad.Value = "U" Then If ObjAcar.UpdateChofer(HdnID.Value.ToEntero(), TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then CargaDatos() Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) + GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing End If End If @@ -136,8 +133,7 @@ Partial Class Acarreos_CatChoferes DdlMunicipio.Items.Clear() If DdlEstado.SelectedValue.ToEntero > 0 Then - Dim ClaveSATEstado As String = GlobalDTEstado("MEX").FiltroPrimeroValor("ClaveSATEstado", $" CveEstado = {DdlEstado.SelectedValue} ") - DdlMunicipio.DataSource = GlobalDTMunicipio(ClaveSATEstado) + DdlMunicipio.DataSource = GlobalDTGralMunicipios("-1", CveEstado:=DdlEstado.SelectedValue.ToEntero) DdlMunicipio.DataBind() End If @@ -153,10 +149,9 @@ Partial Class Acarreos_CatChoferes DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero) DdlLocalidad.DataBind() - DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado("MEX").FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtCP.Text.Trim.Length > 0, $"CP = {TxtCP.Text}", "")) + DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtCP.Text.Trim.Length > 0, TxtCP.Text.ToEntero, -1)) DdlColonia.DataBind() - End If DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) @@ -253,11 +248,9 @@ Partial Class Acarreos_CatChoferes If DdlEstado.SelectedValue > 0 Then - Dim ClaveSATEstado As String = GlobalDTEstado("MEX").FiltroPrimeroValor("ClaveSATEstado", $" CveEstado = {DdlEstado.SelectedValue} ") - DdlMunicipio.DataSource = GlobalDTMunicipio(ClaveSATEstado) + DdlMunicipio.DataSource = GlobalDTGralMunicipios("-1", CveEstado:=DdlEstado.SelectedValue) DdlMunicipio.DataBind() - End If DdlMunicipio.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) @@ -282,12 +275,9 @@ Partial Class Acarreos_CatChoferes DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero) DdlLocalidad.DataBind() - DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado("MEX").FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtCP.Text.Trim.Length > 0, $"CP = {TxtCP.Text}", "")) + DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtCP.Text.Trim.Length > 0, TxtCP.Text.ToEntero, -1)) DdlColonia.DataBind() - - - End If DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) @@ -320,12 +310,11 @@ Partial Class Acarreos_CatChoferes Dim CveColonia As Integer = DdlColonia.SelectedValue.ToEntero If CPTxt > 0 And CveColonia > 0 Then - Dim CP As Integer = GlobalDTColonia(-1).FiltroPrimeroValor("CP", $"CveColonia = {CveColonia}") + Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero If CPTxt <> CP Then - Alert("El codigo postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia) + Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia) End If End If - End Sub Protected Sub DdlColonia_SelectedIndexChanged(sender As Object, e As EventArgs) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index fd2700c84..71e8e6a3a 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -218,16 +218,16 @@ Public Class CFDIComprobante End Property Public Property TipoDocto As String Public Property FormadePago As String - Public Property CondicionesdePago As String + Public Property CondicionesdePago As String = "" Public Property Fecha As Date - Public Property Subtotal As Decimal = 0 + Public Property SubTotal As Decimal = 0 Public Property Descuentos As Decimal = 0 + Public Property Total As Decimal = 0 Public Property MotivoDescuento As String = "" Public Property TipoCambio As String = "1" Public Property Moneda As String = "" Public Property TipoComprobante As String = "" Public Property MetodoPago As String = "" - Public Property Total As Decimal = 0 Public Property LugarExpedicion As String = "" Public Property NumCuentaPago As String = "" Public Property Confirmacion As String = "" @@ -616,9 +616,8 @@ Public Class CFDICartaPorteUbicacion Public Property NumEstacion As String = "" Public Property NombreEstacion As String = "" Public Property NavegacionTrafico As String = "" - Public Property FechaHoraSalida As String = "" + Public Property FechaHoraSalidaLlegada As String = "" Public Property DistanciaRecorrida As Decimal = 0 - Public Property FechaHoraProgLlegada As String Public Property Domicilio As New CFDICartaPorteDomicilio End Class @@ -652,7 +651,11 @@ End Class Public Class CFDICartaPorteMercancias - Public Property PesoBrutoTotal As Double = 0 + Public ReadOnly Property PesoBrutoTotal As Double + Get + Return Mercancias.Sum(Function(item) item.PesoenKg) + End Get + End Property Public Property UnidadPeso As String = "" Public ReadOnly Property PesoNetoTotal As Double Get @@ -706,6 +709,7 @@ Public Class CFDICartaPorteMercanciaTransporta Public Property Cantidad As Decimal = 0 Public Property IDOrigen As String = "" Public Property IDDestino As String = "" + Public Property CvesTransportes As String = "" End Class @@ -744,10 +748,11 @@ End Class Public Class CFDICartaPorteOperador - Public Property RFCOperador As String = "" + Public Property TipoFigura As String = "01" + Public Property RFCFigura As String = "" Public Property NumLicencia As String = "" - Public Property NombreOperador As String = "" - Public Property NumRegidTribOperador As String = "" - Public Property ResidenciaFiscalOperador As String = "" + Public Property NombreFigura As String = "" + Public Property NumRegidTribFigura As String = "" + Public Property ResidenciaFiscalFigura As String = "" Public Property Domicilio As New CFDICartaPorteDomicilio End Class diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index dd22807c3..08b2a0361 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -71,6 +71,7 @@ Public Class ClsEdocumentacion End With If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc Data = New DataTable + DSet = New DataSet() End Sub #Region "Conexiones" @@ -515,6 +516,98 @@ Public Class ClsEdocumentacion #End Region + Public Sub addParameters(varsql As String, sqltipe As SqlDbType, valor As Object) + SqlAdapter.SelectCommand.Parameters.Add(varsql, sqltipe).Value = valor + End Sub + Public Function RunQuery(errormsg As String) As Boolean + Dim retorno As Boolean = False + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + retorno = False + OnError(errormsg, ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + Public Function RunQueryds(errormsg As String) As Boolean + Dim retorno As Boolean = False + Try + SqlAdapter.Fill(DSet) + retorno = True + Catch ex As Exception + retorno = False + OnError(errormsg, ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return retorno + End Function + + +#Region "CRUD_Edoc_Materialidad" + + Public Function TableroMaterialidadGET(cveEmpresa As Integer, anio As Integer, mes As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_TableroMaterialidad", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + retorno = RunQueryds("Ocurrió un error al obtener el PA_Edoc_TableroMaterialidad.") + Return retorno + End Function + Public Function TableroMaterialidadDetalleGET(cveEmpresa As Integer, anio As Integer, mes As Integer, cveCliente As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_TableroMaterialidadDetalle", CommandType.StoredProcedure) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + retorno = RunQueryds("Ocurrió un error al obtener el PA_Edoc_TableroMaterialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadGet(cveDocMaterialidad As Int32, cveDocumentacion As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadGet", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@CveDocumentacion", SqlDbType.Int, cveDocumentacion) + retorno = RunQuery("Ocurrió un error al obtener el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadAdd(cveDocumentacion As Int32, adjunto As String, cveCliente As Integer, anio As Int32, mes As Int32, cveUsuario As Int32, fechaingreso As DateTime) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadAdd", CommandType.StoredProcedure) + addParameters("@CveDocumentacion", SqlDbType.Int, cveDocumentacion) + addParameters("@Adjunto", SqlDbType.VarChar, adjunto) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + retorno = RunQuery("Ocurrió un error al agregar el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadUp(cveDocMaterialidad As Int32, cveDocumentacion As Int32, adjunto As String, cveCliente As Integer, anio As Int32, mes As Int32, cveUsuario As Int32, fechaingreso As DateTime) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadUp", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@Adjunto", SqlDbType.VarChar, adjunto) + addParameters("@CveCliente", SqlDbType.Int, cveCliente) + addParameters("@Anio", SqlDbType.Int, anio) + addParameters("@Mes", SqlDbType.Int, mes) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + retorno = RunQuery("Ocurrió un error al actualizar el Edoc_Materialidad.") + Return retorno + End Function + Public Function Edoc_MaterialidadRemove(cveDocMaterialidad As Int32, CveEmpresa As Integer) As Boolean + + Dim retorno As Boolean = False + DataAdapter("PA_Edoc_MaterialidadRemove", CommandType.StoredProcedure) + addParameters("@CveDocMaterialidad", SqlDbType.Int, cveDocMaterialidad) + addParameters("@CveEmpresa", SqlDbType.Int, CveEmpresa) + retorno = RunQuery("Ocurrió un error al eliminar el Edoc_Materialidad.") + Return retorno + End Function +#End Region + + #Region " P A R A M E T R O S " Public Function AddDocumentacionParametros(CveDocumentacion As Integer, Parametro As String, Descripcion As String, CveEmpresa As Integer, CveUsaurio As Integer) As Boolean diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index fea44cef7..6649955fd 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -592,50 +592,50 @@ Public Class ClsGenerales #End Region -#Region " E S T A D O S" - Public Function GetGralEstados() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_EstadoGet") - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region + '#Region " E S T A D O S" + ' Public Function GetGralEstados() As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Gral_EstadoGet") + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try -#Region " M U N I C I P I O S" - Public Function GetGralMunicipios() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_MunicipioGet") - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region + ' Return Retorno + ' End Function + '#End Region -#Region " P A I S E S" - Public Function GetGralPaises() As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_PaisGet") - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - - Return Retorno - End Function -#End Region + '#Region " M U N I C I P I O S" + ' Public Function GetGralMunicipios() As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Gral_MunicipioGet") + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try + + ' Return Retorno + ' End Function + '#End Region + + '#Region " P A I S E S" + ' Public Function GetGralPaises() As Boolean + ' Dim Retorno As Boolean = False + ' DataAdapter("PA_Gral_PaisGet") + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + ' End Try + + ' Return Retorno + ' End Function + '#End Region #Region " P O B L A C I O N E S" Public Function GetGralPoblaciones() As Boolean @@ -2716,7 +2716,7 @@ Public Class ClsGenerales Public Function GetSATFraccionArancelaria() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_FraccionArancelariaGet") + DataAdapter("PA_Gral_SAT_FraccionArancelariaGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2730,7 +2730,7 @@ Public Class ClsGenerales Public Function GetSATIncoterm() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_IncotermGet") + DataAdapter("PA_Gral_SAT_IncotermGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2744,7 +2744,7 @@ Public Class ClsGenerales Public Function GetSATMotivoTraslado() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_MotivoTrasladoGet") + DataAdapter("PA_Gral_SAT_MotivoTrasladoGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2758,7 +2758,7 @@ Public Class ClsGenerales Public Function GetSATTipoOperacion() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_TipoOperacionGet") + DataAdapter("PA_Gral_SAT_TipoOperacionGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2771,7 +2771,7 @@ Public Class ClsGenerales End Function Public Function GetSATUnidadesAduana() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_UnidadAduanaGet") + DataAdapter("PA_Gral_SAT_UnidadAduanaGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2785,7 +2785,7 @@ Public Class ClsGenerales Public Function GetSATPais() As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_PaisGet") + DataAdapter("PA_Gral_SAT_PaisGet") With SqlAdapter.SelectCommand.Parameters End With Try @@ -2799,7 +2799,7 @@ Public Class ClsGenerales Public Function GetSATEstado(ClaveSATPais As String) As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_EstadoGet") + DataAdapter("PA_Gral_SAT_EstadoGet") With SqlAdapter.SelectCommand.Parameters .Add("@ClaveSATPais", SqlDbType.VarChar).Value = ClaveSATPais End With @@ -2814,7 +2814,7 @@ Public Class ClsGenerales Public Function GetSATMunicipio(ClaveSATEstado As String) As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_MunicipioGet") + DataAdapter("PA_Gral_SAT_MunicipioGet") With SqlAdapter.SelectCommand.Parameters .Add("@ClaveSATEstado", SqlDbType.VarChar).Value = ClaveSATEstado End With @@ -2830,7 +2830,7 @@ Public Class ClsGenerales Public Function GetSATLocalidad(Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1) As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_LocalidadGet") + DataAdapter("PA_Gral_SAT_LocalidadGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEstado", SqlDbType.VarChar).Value = CveEstado .Add("@CveMunicipio", SqlDbType.VarChar).Value = CveMunicipio @@ -2844,11 +2844,13 @@ Public Class ClsGenerales Return Retorno End Function - Public Function GetSATColonia(ClaveSATMunicipio As String) As Boolean + Public Function GetSATColonia(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String) As Boolean Dim Retorno As Boolean = False - DataAdapter("Gral_SAT_ColoniaGet") + DataAdapter("PA_Gral_SAT_ColoniaGet") With SqlAdapter.SelectCommand.Parameters + .Add("@ClaveSATEstado", SqlDbType.VarChar).Value = ClaveSATEstado .Add("@ClaveSATMunicipio", SqlDbType.VarChar).Value = ClaveSATMunicipio + .Add("@ClaveSATColonia", SqlDbType.VarChar).Value = ClaveSATColonia End With Try SqlAdapter.Fill(Data) @@ -3613,8 +3615,10 @@ Public Class ClsGenerales #Region "GRAL TIMBRES" - Public Function AddGralTimbre(TipoDocto As String, Serie As String, Folio As Integer, FolioFiscal As String, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, - Estatus As Integer, CvePAC As Integer, AplicaCP As Boolean, CveEntregaAlmacen As Integer, CveSubProyectoOrigen As Integer) As Integer + Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, + Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, + Optional CveEntregaAlmacen As Integer = -1, + Optional AplicaCP As Boolean = False) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Gral_TimbreAdd") @@ -3624,15 +3628,13 @@ Public Class ClsGenerales .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@Serie", SqlDbType.VarChar).Value = Serie .Add("@Folio", SqlDbType.Int).Value = Folio - .Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal - .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Estatus", SqlDbType.Int).Value = Estatus - .Add("@CvePAC", SqlDbType.Int).Value = CvePAC .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen - .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyectoOrigen + .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output @@ -3654,15 +3656,13 @@ Public Class ClsGenerales Return Retorno End Function - Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, Serie As String, Folio As Integer, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer) As Boolean + Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_TimbreGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@Serie", SqlDbType.VarChar).Value = Serie - .Add("@Folio", SqlDbType.Int).Value = Folio .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@Estatus", SqlDbType.Int).Value = Estatus @@ -3681,37 +3681,49 @@ Public Class ClsGenerales Return Retorno End Function - Public Function UpdateGralTimbre(CveTimbre As Integer, TipoDocto As String, Serie As String, Folio As Integer, FolioFiscal As String, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer, - Estatus As Integer, CvePAC As Integer, CvePACCancelacion As Integer, FechaCancelacion As Date, AplicaCP As Boolean, SelloCancelacion As String - ) As Boolean + Public Function UpdateTimbreTimbrado(CveTimbre As Integer, FolioFiscal As String, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, + CvePAC As Integer) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Gral_TimbreUpdate") + DataAdapter("PA_Gral_TimbreTimbrado") With SqlAdapter.SelectCommand.Parameters .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre - .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto - .Add("@Serie", SqlDbType.VarChar).Value = Serie - .Add("@Folio", SqlDbType.Int).Value = Folio .Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal - .Add("@Fecha", SqlDbType.Date).Value = Fecha - .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha .Add("@CvePAC", SqlDbType.Int).Value = CvePAC - .Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion - .Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion - .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion - - End With Try SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al actualizar el timbre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + + Public Function CancelarTimbreTimbrado(CveTimbre As Integer, FechaCancelacion As DateTime, CvePACCancelacion As Integer, SelloCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Gral_TimbreTimbradoCancelar") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre + .Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion + .Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion + .Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno End Function @@ -3758,22 +3770,24 @@ Public Class ClsGenerales End Function - Public Function AddInvEntregaAlmacenRuta(CveSubProyectoOrigen As Integer, CveMovimientoAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer, Estatus As Integer) As Integer + Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, FechaLlegada As DateTime, Tipo As String, Orden As Integer, Estatus As Integer, Distancia As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Inv_EntregaAlmacenRutaAdd") With SqlAdapter.SelectCommand.Parameters - .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyectoOrigen + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen .Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen .Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino .Add("@CveChofer", SqlDbType.Int).Value = CveChofer .Add("@CveCamion", SqlDbType.Int).Value = CveCamion .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega + .Add("@FechaLlegada", SqlDbType.DateTime).Value = FechaLlegada .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Estatus", SqlDbType.VarChar).Value = Estatus + .Add("@Distancia", SqlDbType.Int).Value = Distancia .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 54d9be053..5ed7caf39 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -8,9 +8,9 @@ Public Class ClsNominas #Region "Campos" 'SQL ClsNominas_Nominas Private SqlConexion As SqlConnection - Private SqlAdapter As SqlDataAdapter + Public SqlAdapter As SqlDataAdapter Private SqlCommand As SqlCommand - Private SqlTransacc As SqlTransaction + Public SqlTransacc As SqlTransaction Private Data As DataTable Private disposedValue As Boolean = False ' Para detectar llamadas redundantes Protected DTSet As DataSet @@ -86,9 +86,12 @@ Public Class ClsNominas Public Property FechaPago As Date #End Region - Public Sub IniciaTransacSQL() - SqlTransacc = SqlConexion.BeginTransaction() - End Sub + + + Public Function IniciaTransacSQL() As SqlTransaction + If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction() + Return SqlTransacc + End Function Public Sub Commit() SqlTransacc.Commit() End Sub @@ -206,7 +209,7 @@ Public Class ClsNominas SqlAdapter.Fill(Data) retorno = True Catch ex As Exception - OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al NominasSinTimbrar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function @@ -223,7 +226,7 @@ Public Class ClsNominas SqlAdapter.Fill(DTSet) retorno = True Catch ex As Exception - OnError("Ocurrió un error al eliminar el finiquito.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al Personal ISR Anual", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function @@ -1032,7 +1035,7 @@ Public Class ClsNominas Return Retorno End Function - Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1, Optional isFiniquito As Boolean = False) As Boolean + Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, FechaTimbrado As DateTime, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1, Optional isFiniquito As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_NominasUpdateEstatus") @@ -1042,7 +1045,7 @@ Public Class ClsNominas .Add("@CveEstatusCFDi", SqlDbType.Int).Value = Estatus .Add("@CvePAC", SqlDbType.Int).Value = CvePAC .Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal - .Add("@SelloDigitalSAT", SqlDbType.VarChar).Value = SelloSAT + .Add("@FechaTimbrado", SqlDbType.DateTime).Value = FechaTimbrado .Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion .Add("@SubTotal", SqlDbType.Money).Value = SubTotal .Add("@Descuento", SqlDbType.Money).Value = Descuento @@ -2258,10 +2261,32 @@ Public Class ClsNominas retorno = True Catch sqEx As SqlException retorno = False - OnError("Ocurrió un error al Realizar el calculo de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de nomina.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception retorno = False - OnError("Ocurrió un error al Realizar el calculo de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetNominasSinTimbrar(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + Try + DTSet = New DataSet() + DataAdapter("PA_Nom_NominaSinTimbrar", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener la nomina sin timbrar.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener la nomina sin timbrar.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7ff070146..3026f8e2b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -372,56 +372,68 @@ Public Class ClsPaginas End Set End Property - Property GlobalDTPais() As DataTable + + Property GlobalDTGralPaises() As DataTable Get - GlobalDTPais = DirectCast(Application("GlobalDTPais"), DataTable) + If Application("GlobalDTGralPaises") Is Nothing Then + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetSATPais() Then Application("GlobalDTGralPaises") = ObjGrales.DtResultados Else Application("GlobalDTGralPaises") = Nothing + ObjGrales.Dispose() + End If + GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable) End Get Set(value As DataTable) - Application("GlobalDTPais") = value + Application("GlobalDTGralPaises") = value End Set End Property - - Property GlobalDTEstado(ClaveSATPais As String) As DataTable + Property GlobalDTGralEstados(ClaveSATPais As String, Optional CvePais As Integer = -1) As DataTable Get - If Application("GlobalDTEstado") Is Nothing Then + Dim AppNombre As String = "GlobalDTGralEstados" + If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing + If ObjGrales.GetSATEstado("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing ObjGrales.Dispose() End If - If ClaveSATPais <> "-1" Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows) - GlobalDTEstado = Dv.ToTable - Dv.Dispose() - Else - GlobalDTEstado = DirectCast(Application("GlobalDTEstado"), DataTable) - End If + Dim Filtro As New StringBuilder + Filtro.Append(" 1 = 1 ") + If ClaveSATPais <> "-1" Then Filtro.AppendFormat(" AND ClaveSATPais = '{0}' ", ClaveSATPais) + If CvePais > 0 Then Filtro.AppendFormat(" AND CvePais = {0} ", CvePais) + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTGralEstados = Dv.ToTable + Dv.Dispose() End Get Set(value As DataTable) - Application("GlobalDTEstado") = value + Dim AppNombre As String = "GlobalDTGralEstados" + Application(AppNombre) = value End Set End Property - Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable + Property GlobalDTGralMunicipios(ClaveSATEstado As String, Optional CveEstado As Integer = -1) As DataTable Get - If Application("GlobalDTMunicipio") Is Nothing Then + + Dim AppNombre As String = "GlobalDTGralMunicipios" + If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing + If ObjGrales.GetSATMunicipio("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing ObjGrales.Dispose() End If - If ClaveSATEstado <> "-1" Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows) - GlobalDTMunicipio = Dv.ToTable - Dv.Dispose() - Else - GlobalDTMunicipio = DirectCast(Application("GlobalDTMunicipio"), DataTable) - End If + Dim Filtro As New StringBuilder + Filtro.Append(" 1 = 1 ") + If ClaveSATEstado <> "-1" Then Filtro.AppendFormat(" AND ClaveSATEstado = '{0}' ", ClaveSATEstado) + If CveEstado > 0 Then Filtro.AppendFormat(" AND CveEstado = {0} ", CveEstado) + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTGralMunicipios = Dv.ToTable + Dv.Dispose() End Get Set(value As DataTable) - Application("GlobalDTMunicipio") = value + Dim AppNombre As String = "GlobalDTGralMunicipios" + Application(AppNombre) = value End Set End Property @@ -466,26 +478,34 @@ Public Class ClsPaginas End Property - - Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable + Property GlobalDTGralColonias(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String, + Optional CveMunicipio As Integer = -1, Optional CodigoPostal As Integer = -1, Optional CveColonia As Integer = -1) As DataTable Get - If Application("GlobalDTColonia") Is Nothing Then + Dim AppNombre As String = "GlobalDTGralColonias" + If Application(AppNombre) Is Nothing Then Dim ObjGrales As New ClsGenerales - If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing + If ObjGrales.GetSATColonia("-1", "-1", "-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing ObjGrales.Dispose() End If - If ClaveSATMunicipio <> "-1" Then - Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows) - GlobalDTColonia = Dv.ToTable - Dv.Dispose() - Else - GlobalDTColonia = DirectCast(Application("GlobalDTColonia"), DataTable) - End If + Dim Filtro As New StringBuilder + Filtro.Append(" 1 = 1 ") + If ClaveSATEstado <> "-1" Then Filtro.AppendFormat(" AND ClaveSATEstado = '{0}' ", ClaveSATEstado) + If ClaveSATMunicipio <> "-1" Then Filtro.AppendFormat(" AND ClaveSATMunicipio = '{0}' ", ClaveSATMunicipio) + If ClaveSATColonia <> "-1" Then Filtro.AppendFormat(" AND ClaveSATColonia = '{0}' ", ClaveSATColonia) + If CveMunicipio > 0 Then Filtro.AppendFormat(" AND CveMunicipio = {0} ", CveMunicipio) + If CodigoPostal > 0 Then Filtro.AppendFormat(" AND CP = {0} ", CodigoPostal) + If CveColonia > 0 Then Filtro.AppendFormat(" AND CveColonia = {0} ", CveColonia) + + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows) + GlobalDTGralColonias = Dv.ToTable + Dv.Dispose() + End Get Set(value As DataTable) - Application("GlobalDTColonia") = value + Dim AppNombre As String = "GlobalDTGralColonias" + Application(AppNombre) = value End Set End Property @@ -927,6 +947,32 @@ Public Class ClsPaginas Application("GlobalDTFamilias") = value End Set End Property + + Property GlobalDTChoferes(CveEmpresa As Integer, Optional CveChofer As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTChoferes-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjAcar As New ClsAcarreos() + If ObjAcar.GetChofer(-1, CveEmpresa, 1, -1) Then + Application(AppNombre) = ObjAcar.DtResultados + End If + ObjAcar.Dispose() + End If + + Dim Str As New StringBuilder + If CveChofer > 0 Then Str.AppendFormat("CveChofer = {0}", CveChofer) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTChoferes = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTChoferes-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property + Property GlobalDTClasificacionesPresupuestos(Optional CveEmpresa As Integer = -1) As DataTable Get If CveEmpresa <> -1 Then @@ -1563,6 +1609,31 @@ Public Class ClsPaginas Application("GlobalDTInvMetodosInventario") = value End Set End Property + + Property GlobalDTInvCamiones(CveEmpresa As Integer, Optional CveCamion As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTInvCamiones-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then + Application(AppNombre) = ObjInventarios.DtResultados + End If + ObjInventarios.Dispose() + End If + + Dim Str As New StringBuilder + If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTInvCamiones = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTInvCamiones-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property Property GlobalDTAFCaracteristicasOpciones() As DataTable Get GlobalDTAFCaracteristicasOpciones = DirectCast(Application("GlobalDTAFCaracteristicasOpciones"), DataTable) @@ -1850,7 +1921,7 @@ Public Class ClsPaginas Application("GlobalDTClientesCorporativo") = value End Set End Property - Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1) As DataTable + Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1, Optional RFC As String = "-1") As DataTable Get Dim AppNombre As String = String.Format("GlobalDTCompProveedores-{0}", CveEmpresa) 'sino existe, recarga los datos @@ -1864,6 +1935,7 @@ Public Class ClsPaginas Dim StrSQL As New StringBuilder StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor) + If RFC <> "-1" Then StrSQL.AppendFormat(" AND RFC = '{0}' ", RFC) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) GlobalDTCompProveedores = Dv.ToTable @@ -2368,39 +2440,6 @@ Public Class ClsPaginas #End Region #Region "***********************************************************************DT GENERALES**************************************************************************************" - Property GlobalDTGralPaises() As DataTable - Get - GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTGralPaises") = value - End Set - End Property - Property GlobalDTGralEstados(CvePais As Integer) As DataTable - Get - GlobalDTGralEstados = DirectCast(Application("GlobalDTGralEstados"), DataTable).FiltraParametros(String.Format("CvePais ={0}", CvePais)) - End Get - Set(value As DataTable) - Application("GlobalDTGralEstados") = value - End Set - End Property - Property GlobalDTGralMunicipios(CveEstado As Integer) As DataTable - Get - GlobalDTGralMunicipios = DirectCast(Application("GlobalDTGralMunicipios"), DataTable).FiltraParametros(String.Format("CveEstado ={0}", CveEstado)) - End Get - Set(value As DataTable) - Application("GlobalDTGralMunicipios") = value - End Set - End Property - - Property GlobalDTGralPoblaciones() As DataTable - Get - GlobalDTGralPoblaciones = DirectCast(Application("GlobalDTGralPoblaciones"), DataTable) - End Get - Set(value As DataTable) - Application("GlobalDTGralPoblaciones") = value - End Set - End Property Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable Get @@ -5148,6 +5187,9 @@ Public Class ClsPaginas PaginaDict.Add("/RH/RepVacaciones.aspx".ToUpper(), 422) PaginaDict.Add("/RH/CatChecadorTipo.aspx".ToUpper(), 427) PaginaDict.Add("/RH/CatChecadorHorarios.aspx".ToUpper(), 428) + PaginaDict.Add("/Documentacion/TableroMaterialidad.aspx".ToUpper(), -1) + PaginaDict.Add("/Documentacion/TableroMaterialidadDetalle.aspx".ToUpper(), -1) + PaginaDict.Add("/RH/RepChecadorPreAsistencia.aspx".ToUpper(), 628) PaginaDict.Add("/RH/CatCaptaciones.aspx".ToUpper(), 629) @@ -6468,7 +6510,7 @@ Public Class ClsPaginas params.Add(New CrystalParametro("INETipoComite", INETipoComite)) params.Add(New CrystalParametro("INEIdContabilidad", INEIdContabilidad)) params.Add(New CrystalParametro("Referencia", Vta.Cliente.ReferenciaFiscal)) - params.Add(New CrystalParametro("ClienteContacto", Vta.AtnA)) + params.Add(New CrystalParametro("ClienteContacto", Vta.AtencionA)) End If 'DIRECCION ENVIO @@ -6699,7 +6741,7 @@ Public Class ClsPaginas GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex)) End Try End Sub - Protected Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True) As Byte() + Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True) As Byte() Dim retorno As Byte() = Nothing ' Dim ObjVentas As New ClsVentas @@ -6771,12 +6813,9 @@ Public Class ClsPaginas End Try If EsXMLValido Then - Dim TC As Decimal = 1 - Try - TC = XmlDoc.DocumentElement.Attributes("TipoCambio").InnerText.ToDecimal - Catch ex As Exception - TC = 1 - End Try + Dim TC As Decimal = ValorNodoXML(XmlDoc.DocumentElement, "TC").ToDecimal + If TC <= 0 Then TC = 1 + If ValorNodoXML(XmlDoc.DocumentElement, "version") = "3.3" Then Vta.FechaEmision = ValorNodoXML(XmlDoc.DocumentElement, "fecha").ToDate Vta.NoSerieCertificadoContribuyente = ValorNodoXML(XmlDoc.DocumentElement, "NoCertificado") @@ -7076,7 +7115,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("ClienteNoInt", If(Vta.ClienteSucursal.NoInt.Length > 0, Vta.ClienteSucursal.NoInt, ""))) params.Add(New ReportParameter("ClienteNoExt", If(Vta.ClienteSucursal.NoExt.Length > 0, Vta.ClienteSucursal.NoExt, ""))) params.Add(New ReportParameter("ClientePais", If(Vta.ClienteSucursal.Pais.Length > 0, Vta.ClienteSucursal.Pais, ""))) - params.Add(New ReportParameter("ClienteContacto", Vta.AtnA)) + params.Add(New ReportParameter("ClienteContacto", Vta.AtencionA)) ElseIf Vta.CveCliente.ToEntero > 0 Then params.Add(New ReportParameter("ClienteCalle", If(Vta.Cliente.Direccion.Length > 0, Vta.Cliente.Direccion, ""))) params.Add(New ReportParameter("ClienteColonia", If(Vta.Cliente.Colonia.Length > 0, Vta.Cliente.Colonia, ""))) @@ -7087,7 +7126,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("ClienteNoInt", If(Vta.Cliente.NoInt.Length > 0, Vta.Cliente.NoInt, ""))) params.Add(New ReportParameter("ClienteNoExt", If(Vta.Cliente.NoExt.Length > 0, Vta.Cliente.NoExt, ""))) params.Add(New ReportParameter("ClientePais", If(Vta.Cliente.Pais.Length > 0, Vta.Cliente.Pais, ""))) - params.Add(New ReportParameter("ClienteContacto", Vta.AtnA)) + params.Add(New ReportParameter("ClienteContacto", Vta.AtencionA)) End If 'PARAMETROS SEGUN TIPO DOCUMENTO @@ -7248,7 +7287,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("INETipoComite", INETipoComite)) params.Add(New ReportParameter("INEIdContabilidad", INEIdContabilidad.ToString)) params.Add(New ReportParameter("Referencia", Vta.Cliente.ReferenciaFiscal)) - params.Add(New ReportParameter("ClienteContacto", Vta.AtnA)) + params.Add(New ReportParameter("ClienteContacto", Vta.AtencionA)) End If RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) @@ -7372,8 +7411,8 @@ Public Class ClsPaginas RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) - Case "RNC" + Case "RNC" NombreArchivo = "RemisionNC" NombreArchivoDescarga = "RemisionNC" diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index cce1984f6..5c1b1d796 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1966,15 +1966,18 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo _CvePersonal = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero Retorno = True Catch Ex1 As SqlException + 'dbo.Vw_Val_Nom_Curps If Ex1.Message.Contains("Número: 2627;") Then - Alert("El Nuevo Personal no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) + Alert("El nuevo personal no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia) ElseIf Ex1.Message.Contains("Chk_RH_PersonalSalarioIMSS") Then - Alert("El Nuevo Personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) + Alert("El nuevo personal no se guardo debido a que se presento un problema al calcular el salario", TipoMensaje.MsgAdvertencia) + ElseIf Ex1.Message.Contains("dbo.Vw_Val_Nom_Curps") Then + Alert(String.Format("El nuevo personal no se guardo, ya existe un personal con esta curp '{0}'", CURP), TipoMensaje.MsgAdvertencia) Else - Me.OnError("Ocurrió un error al guardar el nuevo Personal.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Me.OnError("Ocurrió un error al guardar el nuevo personal.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If Catch ex As Exception - OnError("Ocurrió un error al guardar el nuevo Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al guardar el nuevo personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 44bd17ea6..ad1c04887 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -552,6 +552,24 @@ Public Class ClsVentas End Try Return Retorno End Function + + + Public Function UpdateDireccionEnvioVenta(CveVenta As Integer, CveDireccionEnvio As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_VentasDireccionEnvioUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la dirección de envío de la venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function Public Function AddVta_VentaPago(CveVenta As Integer, CveMetodoPago As Integer, Importe As Double) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasPagoAdd") diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index a23c7af68..7f68a1c1b 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6175,6 +6175,7 @@ Namespace Modelos Public Property DtMovimientosUsados As DataTable Public Property CveAlmacenDevolucion As Integer Public Property CveVenta As Integer + Public Property CveTimbre As Integer Public Property CveEmpresa As Integer Public Property CveSucursal As Integer 'sucursal de la empresa que factura Public Property CveSubProyecto As Integer @@ -6244,7 +6245,7 @@ Namespace Modelos End Property Public Property Inv_CveMovimiento As Integer - Public Property Inv_CveEstatusEntrega As Integer + Public Property Inv_CveEstatusEntrega As Integer = 0 Public Property Inv_EstatusEntrega As String Public Property Inv_ValorInventario As Decimal Public Property Fecha As DateTime @@ -6266,7 +6267,8 @@ Namespace Modelos Public Property EstatusFactura As String Public Property SeTimbro As String Public Property TipoDocto As String - Public Property RefDocto As String + Public Property TipoComprobante As String + Public Property RefDocto As String = "" Public Property RealizarDevolucionAlmacen As Boolean Public Property CveAlmacenDevolucionVenta As Integer @@ -6402,24 +6404,24 @@ Namespace Modelos End Get End Property - Public Property MotivoDescuento As String + Public Property MotivoDescuento As String = "" #Region "Totales" - Public Property SubTotal As Decimal - Public Property Descuento As Decimal - Public Property Amortizacion As Decimal + Public Property SubTotal As Decimal = 0 + Public Property Descuento As Decimal = 0 + Public Property Amortizacion As Decimal = 0 'IVA - Public Property RetIVA As Decimal - Public Property RetISR As Decimal - Public Property IVA As Decimal - Public Property IEPS As Decimal + Public Property RetIVA As Decimal = 0 + Public Property RetISR As Decimal = 0 + Public Property IVA As Decimal = 0 + Public Property IEPS As Decimal = 0 - Public Property Total As Decimal - Public Property Otros As Decimal + Public Property Total As Decimal = 0 + Public Property Otros As Decimal = 0 - Public Property TotalRemNCAplicado As Decimal + Public Property TotalRemNCAplicado As Decimal = 0 #Region "Totales por Tipo de cambio" @@ -6507,32 +6509,31 @@ Namespace Modelos End Property #End Region #End Region - Public Property AtencionA As String - Public Property AtnA As String - Public Property TelefonoGenerico As String - Public Property Det_OrdenCompra As String - Public Property Det_FechaOrdenCompra As String - Public Property Det_ContraRecibo As String - Public Property Observaciones As String + Public Property AtencionA As String = "" + Public Property TelefonoGenerico As String = "" + Public Property Det_OrdenCompra As String = "" + Public Property Det_FechaOrdenCompra As String = "" + Public Property Det_ContraRecibo As String = "" + Public Property Observaciones As String = "" - Public Property Alfa1 As String - Public Property Alfa2 As String - Public Property Alfa3 As String + Public Property Alfa1 As String = "" + Public Property Alfa2 As String = "" + Public Property Alfa3 As String = "" Public Property Fech1 As Date Public Property Fech2 As Date Public Property Fech3 As Date - Public Property Num1 As Double - Public Property Num2 As Double - Public Property Num3 As Double + Public Property Num1 As Double = 0 + Public Property Num2 As Double = 0 + Public Property Num3 As Double = 0 Public Property DiasCredito As Integer Public Property EsDiasCreditoFijo As Boolean - Public Property CveCorte As Integer - Public Property CveMesa As Integer - Public Property NumeroPersonas As Integer + Public Property CveCorte As Integer = -1 + Public Property CveMesa As Integer = -1 + Public Property NumeroPersonas As Integer = 0 Public Property FechaPago As Date @@ -6540,15 +6541,15 @@ Namespace Modelos Public Property CveNCaVincular As Integer Public Property FolioFiscal As String Public Property NoSerieCertificado As String - Public Property SelloCFDi As String - Public Property SelloSAT As String + Public Property SelloCFDi As String = "" + Public Property SelloSAT As String = "" Public Property FechaEmision As Date Public Property FechaCertificacion As Date Public Property NoSerieCertificadoContribuyente As String - Public Property NumeroCuenta As String + Public Property NumeroCuenta As String = "" Public Property CveTipoAmortizacionAnticipo As Integer = -1 - Public Property DescripcionContrato As String - Public Property NumeroDescripcionContrato As String + Public Property DescripcionContrato As String = "" + Public Property NumeroDescripcionContrato As String = "" Public Property CveComplementoTimbrado As Integer = 0 Public Property ComplementoINE As Modelos.ComplementoINE Public Property FordGSDB As String = "" @@ -6646,28 +6647,28 @@ Namespace Modelos End If End Sub - Public Property CveClienteSucursal As Integer + Public Property CveClienteSucursal As Integer = 0 Public Property ClienteSucursal As Modelos.SucursalModel Public Property EnviarA As Modelos.EnviarAModel - Public Property NumeroContrato As String - Public Property PedidoContrato As String - Public Property OrdenCompra As String = "-1" + Public Property NumeroContrato As String = "" + Public Property PedidoContrato As String = "" + Public Property OrdenCompra As String = "" Public Property CveMetodoPago As Integer - Public Property MetodoPago As String - Public Property ClaveMetodoPagoSAT As String + Public Property MetodoPago As String = "" + Public Property ClaveMetodoPagoSAT As String = "" Public Property CveMetodoPago33 As Integer - Public Property MetodoPago33 As String + Public Property MetodoPago33 As String = "" Public Property CveFormaPago33 As Integer - Public Property MetodoPagoSAT33 As String - Public Property FormaPago33 As String - Public Property FormaPagoSAT33 As String + Public Property MetodoPagoSAT33 As String = "" + Public Property FormaPago33 As String = "" + Public Property FormaPagoSAT33 As String = "" Public Property UsoCFDI As String = "" Public Property CveUsoCFDI As Integer Public Property ClaveUsoCFDI As String = "" Public Property CveTipoRelacion As Integer = -1 Public Property CveEstatusFactura As Integer Public Property CveVendedor As Integer - Public Property VendedorCodigo As String + Public Property VendedorCodigo As String = "" Public Property CveSucursalEjecucion As Integer Public Property FechaEjecucion As Date Public Property CveSucursalCobranza As Integer @@ -6675,15 +6676,15 @@ Namespace Modelos Public Property CveSubProyectoCobranza As Integer Public Property CveSubProyectoEjecucion As Integer Public Property CveOS As Integer - Public Property CveContrato As Integer - Public Property CveVentaPadre As Integer - Public Property CvePrePoliza As Integer - Public Property Entrega As String - Public Property TiempoEntrega As String + Public Property CveContrato As Integer = -1 + Public Property CveVentaPadre As Integer = -1 + Public Property CvePrePoliza As Integer = -1 + Public Property Entrega As String = "" + Public Property TiempoEntrega As String = "" Public Property Vigencia As Date Public Property TipoEstatus As Integer Public Property CveCondicionEntrega As Integer - Public Property CondicionEntrega As String + Public Property CondicionEntrega As String = "" Public Property TipoRelacion As String Public Property UUIDRelacionados As List(Of String) @@ -9667,21 +9668,21 @@ Namespace Modelos End Sub Public Property AplicaFEMSA As Boolean = False 'AplicaFEMSA - Public Property FEMSA_NumSociedad As String 'TxtFEMSA_NumSociedad.Text.Trim, - Public Property FEMSA_NumProveedor As String 'TxtFEMSA_NumProveedor.Text.Trim, - Public Property FEMSA_Mail As String 'TxtFEMSA_Mail.Text.Trim + Public Property FEMSA_NumSociedad As String = "" 'TxtFEMSA_NumSociedad.Text.Trim, + Public Property FEMSA_NumProveedor As String = "" 'TxtFEMSA_NumProveedor.Text.Trim, + Public Property FEMSA_Mail As String = "" 'TxtFEMSA_Mail.Text.Trim - Public Property FEMSA_Version As Integer 'TxtFEMSA_Version.Text.ToEntero, ClaseDocto, + Public Property FEMSA_Version As Integer 'TxtFEMSA_Version.Text.ToEntero, ClaseDocto, Public Property FEMSA_NumPedido As Long 'TxtFEMSA_NumPedido.Text.Trim.ToLong, - Public Property FEMSA_NumEntrada As String 'TxtFEMSA_NumEntrada.Text.Trim, - Public Property FEMSA_NumRemision As String 'TxtFEMSA_NumRemision.Text.Trim, - Public Property FEMSA_NumSocio As String 'TxtFEMSA_NumSocio.Text.Trim, - Public Property FEMSA_CentroCosto As String 'TxtFEMSA_CentroCosto.Text.Trim, - Public Property FEMSA_IPeriodoLiquidacion As String 'TxtFEMSA_IPeriodoLiquidacion.Text.Trim, - Public Property FEMSA_FPeriodoLiquidacion As String 'TxtFEMSA_FPeriodoLiquidacion.Text.Trim, - Public Property FEMSA_CodRetencion1 As String 'TxtFEMSA_CodRetencion1.Text.Trim, - Public Property FEMSA_CodRetencion2 As String 'TxtFEMSA_CodRetencion2.Text.Trim, + Public Property FEMSA_NumEntrada As String = "" 'TxtFEMSA_NumEntrada.Text.Trim, + Public Property FEMSA_NumRemision As String = "" 'TxtFEMSA_NumRemision.Text.Trim, + Public Property FEMSA_NumSocio As String = "" 'TxtFEMSA_NumSocio.Text.Trim, + Public Property FEMSA_CentroCosto As String = "" 'TxtFEMSA_CentroCosto.Text.Trim, + Public Property FEMSA_IPeriodoLiquidacion As String = "" 'TxtFEMSA_IPeriodoLiquidacion.Text.Trim, + Public Property FEMSA_FPeriodoLiquidacion As String = "" 'TxtFEMSA_FPeriodoLiquidacion.Text.Trim, + Public Property FEMSA_CodRetencion1 As String = "" 'TxtFEMSA_CodRetencion1.Text.Trim, + Public Property FEMSA_CodRetencion2 As String = "" 'TxtFEMSA_CodRetencion2.Text.Trim, End Class diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index d354d4be3..19d241d77 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -1754,7 +1754,7 @@ Public Class Timbrado If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then Using ObjNomina2 As New ClsNominas() - If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then + If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then Retorno = "" Else Retorno = "Error" @@ -2137,16 +2137,16 @@ Public Class Timbrado Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte ''DATOS GENERALES - cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "MEX", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida) + cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida) 'UBICACIONES If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones 'origen - cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.IDUbicacion, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalida, ubica.TipoEstacion, ubica.DistanciaRecorrida) + cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida) 'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida) cfdi.CartaPorteDomicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP) - '''destino + ''''destino 'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorridaDestino) '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) @@ -2154,16 +2154,18 @@ Public Class Timbrado End If - 'MERCANCIAS - If Carta.Mercancias IsNot Nothing Then - cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion) - If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then - For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias + 'MERCANCIAS + If Carta.Mercancias IsNot Nothing Then + cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion) + If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then + For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt) + For Each transp In concep.MercanciasCantidadTransporta + cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes) + Next Next - End If End If - + End If ' If Carta.FiguraTransporte IsNot Nothing Then @@ -2186,13 +2188,15 @@ Public Class Timbrado 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.CartaPorteOperador(concep.RFCOperador, concep.NumLicencia, concep.NombreOperador, concep.NumRegidTribOperador, concep.ResidenciaFiscalOperador) - ' cfdi.CartaPorteOperadorDomicilio(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) - ' Next - ' 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 @@ -2414,45 +2418,28 @@ Public Class Timbrado swmili = sw.ElapsedMilliseconds sw.Start() - If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then + Select Case ObjCFDITimbre.Comprobante.TipoComprobante + Case "N" - 'Actualiza Estatus Factura - If Ventas.CveVenta > 0 Then - - Using ObjVentas As New ClsVentas() - - If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then - Retorno = "" - Else - Retorno = "Error" - End If - End Using - - 'Genero la addenda Ford - If Ventas.Cliente.Ford_GSDB <> "" Then - - Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio)) - - Dim FolioFactura As String = "" - If UsuarioActual.CveEmpresa = 8 Then FolioFactura = Ventas.Folio.ToString ' sogo, pordefault manda el folio de la factura - GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB) - - End If - - End If - - If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then Using ObjNomina2 As New ClsNominas() - If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then + If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then Retorno = "" Else Retorno = "Error" End If End Using - End If - If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then + Case "T" + + Dim objGrales As New ClsGenerales + If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC) Then + Retorno = "" + Else + Retorno = "Error" + End If + objGrales.Dispose() + Using ObjInv As New ClsInventarios() If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then Retorno = "" @@ -2460,8 +2447,36 @@ Public Class Timbrado Retorno = "Error" End If End Using - End If - End If + + + Case Else + + 'Actualiza Estatus Factura + If Ventas.CveVenta > 0 Then + + Using ObjVentas As New ClsVentas() + + If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then + Retorno = "" + Else + Retorno = "Error" + End If + End Using + + 'Genero la addenda Ford + If Ventas.Cliente.Ford_GSDB <> "" Then + + Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio)) + + Dim FolioFactura As String = "" + If UsuarioActual.CveEmpresa = 8 Then FolioFactura = Ventas.Folio.ToString ' sogo, pordefault manda el folio de la factura + GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB) + + End If + + End If + End Select + If Not IO.Directory.Exists($"{UsuarioActual.Empresa.Ruta}CBB\") Then IO.Directory.CreateDirectory($"{UsuarioActual.Empresa.Ruta}CBB\") @@ -3047,7 +3062,7 @@ Public Class Timbrado If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then Using ObjNomina2 As New ClsNominas() - If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then + If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then Retorno = "" Else Retorno = "Error" @@ -3936,10 +3951,10 @@ Public Class Timbrado ComCartaPorte.FiguraTransporte.Operadores = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador(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.RFCOperador + ComCartaPorte.FiguraTransporte.Operadores(i).RFCOperador = concep.RFCFigura ComCartaPorte.FiguraTransporte.Operadores(i).NumLicencia = concep.NumLicencia - ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreOperador - ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribOperador + ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreFigura + ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribFigura 'OComCartaPorte.FiguraTransporte.Operadores(i)(0) = concep.ResidenciaFiscalOperador 'falta ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperadorDomicilio() diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb new file mode 100644 index 000000000..e77192c72 --- /dev/null +++ b/App_Code/Timbres.vb @@ -0,0 +1,359 @@ +Imports System.Data +Imports Extensiones + +Public Class Timbres + Private _MsgError As StringBuilder + Private _MensajeAlert As StringBuilder + Public Property TieneError As Boolean + Public ReadOnly Property MsgError As String + Get + Return _MsgError.ToString + End Get + End Property + + Public ReadOnly Property MensajeAlert As String + Get + Return _MensajeAlert.ToString + End Get + End Property + + Private Property CveMovimiento As Integer + Private Property UsuarioActual As Usuario + Private Property AplicaCP As Boolean + Private Property FechaSalida As Date + Private Property Serie As String + Private Property Folio As Integer + Private Property CveTimbre As Integer + + Private Property CPCliente As Integer + Public Property ObjFactura As Modelos.Factura + + Public Sub New() + + End Sub + + Public Sub New(TipoDocto As String, tCveTimbre As Integer, tUsuarioActual As Usuario) + _MsgError = New StringBuilder + UsuarioActual = tUsuarioActual + CveTimbre = tCveTimbre + CreaObjetosTraslados(TipoDocto, tCveTimbre) + End Sub + + + Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer) + ObjFactura = New Modelos.Factura + ObjFactura.Version = "3.3" + ObjFactura.CveUsuario = UsuarioActual.CveUsuario + ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa + ObjFactura.UsuarioActual = UsuarioActual + 'ObjFactura.TipoCambio = 1 + ObjFactura.ConvertirPesos = False + ObjFactura.CveMoneda = 1 + ObjFactura.Moneda = "XXX" + ObjFactura.MonedaSAT = "XXX" + ObjFactura.MonedaAbreviatura = "XXX" + ObjFactura.TipoDocto = TipoDocto + ObjFactura.TipoComprobante = "T" + + ObjFactura.Fecha = Now + ObjFactura.FechaPago = Now + ObjFactura.FechaEjecucion = Now + ObjFactura.UsuarioCreo = UsuarioActual.Usuario + ObjFactura.TipoDocumento = "Traspaso" + + + ObjFactura.RFCReceptor = "XAXX010101000" ' RFC empresa traslado , si es entrega RFC Cliente + + ObjFactura.Inv_CveMovimiento = CveMovimiento + ObjFactura.CveTimbre = CveTimbre + + If CveTimbre > 0 AndAlso ObjFactura.TipoComprobante = "T" Then + + ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura) + + End If + + End Sub + + Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre + Dim Timbre As New CFDITimbre + Timbre.Comprobante.TipoComprobante = "T" + Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 + Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT + Timbre.Comprobante.SubTotal = Obj.SubTotal + Timbre.Comprobante.Descuentos = Obj.Descuento + Timbre.Comprobante.Moneda = "XXX" + Timbre.Comprobante.TipoCambio = "" ' CONDICIÓN SI LA MONEDA ES 'XXX' + + Timbre.Receptor.RFC = UsuarioActual.Empresa.RFC + Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa + Timbre.Receptor.UsoCFDI = "P01" + + + Dim totSubTotal As Decimal = Obj.SubTotal + Dim totIVA As Decimal = Obj.IVA + Dim totRetIVA As Decimal = Obj.RetIVA + Dim totRetISR As Decimal = Obj.RetISR + Dim i As Integer = 1 + + + Timbre.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString + + + 'DETALLES + Dim tPS As String = "" + + Dim CartaPorte As New CFDICartaPorte + CartaPorte.TranspInternac = "No" + CartaPorte.EntradaSalidaMercancia = "" + CartaPorte.ViaEntradaSalida = "" + + CartaPorte.Mercancias.UnidadPeso = "KGM" + CartaPorte.Mercancias.CargoporTasacion = 0 + + Dim FI As Date = New Date(1900, 1, 1) + Dim FF As Date = New Date(9999, 1, 1) + + Dim FechaLlegada As DateTime + Dim Distancia As Integer = 1 + + Dim ObjGrales As New ClsGenerales + If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then + + If ObjGrales.DtResultados.Rows.Count = 1 Then + Dim DtMovimientos As DataTable = Nothing + + Dim drT As DataRow = ObjGrales.DtResultados.Rows(0) + + CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero + FechaSalida = drT("FechaEntrega").ToString.ToDateTime + FechaLlegada = drT("FechaLlegada").ToString.ToDateTime + Distancia = drT("Distancia").ToString.ToEntero + + ObjFactura.Folio = drT("Folio").ToString.ToEntero + ObjFactura.Serie = drT("Serie").ToString + Timbre.Comprobante.Serie = Obj.Serie + Timbre.Comprobante.Folio = Obj.Folio.ToString + + If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then + DtMovimientos = ObjGrales.DtResultados + Else + TieneError = True + _MsgError.AppendLine("Error al obtener Movimientos") + End If + + ObjFactura.DtDetalle = DtMovimientos + + AplicaCP = Boolean.Parse(drT("AplicaCP").ToString) + + ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero + + ObjFactura.SetSubProyecto() + ObjFactura.SetSubProyectoMatriz() + + If AplicaCP Then + + CartaPorte.FiguraTransporte.AutoTransporte.PermSCT = drT("TipoPermisoSCT").ToString '"TPAF01" + CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString + CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString + CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString + CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero + + CPCliente = drT("CPCliente").ToString.ToEntero + + + Dim DomOrigen As CFDICartaPorteDomicilio = Nothing + DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString, + .Colonia = drT("DirOriClaveSATColonia").ToString, + .CP = drT("DirOriCP").ToString, + .Estado = drT("DirOriClaveSATEstado").ToString, + .Pais = drT("DirOriClaveSATPais").ToString, + .Municipio = drT("DIrOriClaveSATMunicipio").ToString, + .Localidad = drT("DirOriClaveSATLocalidad").ToString} + + Dim DomDestino As CFDICartaPorteDomicilio = Nothing + + + DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString, + .Colonia = drT("DirDesClaveSATColonia").ToString, + .CP = drT("DirDesCP").ToString, + .Estado = drT("DirDesClaveSATEstado").ToString, + .Pais = drT("DirDesClaveSATPais").ToString, + .Municipio = drT("DirDesClaveSATMunicipio").ToString, + .Localidad = drT("DirDesClaveSATLocalidad").ToString} + + + Dim Ubica As New CFDICartaPorteUbicacion + Ubica.TipoEstacion = "" + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC, + .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, + .Domicilio = DomOrigen} + CartaPorte.Ubicaciones.Add(Ubica) + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,'"CAMJ841219I33", + .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), + .NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa, + .Domicilio = DomDestino, + .DistanciaRecorrida = Distancia} + + CartaPorte.Ubicaciones.Add(Ubica) + CartaPorte.FiguraTransporte.ClaveTransporte = "01" + + Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString, + .NumeroExterior = drT("FiguraNumeroExterior").ToString, + .NumeroInterior = drT("FiguraNumeroInterior").ToString, + .Colonia = drT("FiguraClaveSATColonia").ToString, + .Municipio = drT("FiguraClaveSATMunicipio").ToString, + .Estado = drT("FiguraClaveSATEstado").ToString, + .CP = drT("FiguraCP").ToString} + + + + CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With { + .RFCFigura = drT("FiguraRFC").ToString, + .NombreFigura = drT("FiguraChofer").ToString, + .NumLicencia = drT("FiguraLicencia").ToString, + .NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString, + .ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString, + .Domicilio = DomicilioOperador}) + + + 'concepto único + Dim concepto As New CFDIConceptos With {.Cantidad = 1, + .Descripcion = "Flete", + .ValorUnitario = 0, + .Importe = 0, + .Descuento = 0, + .Unidad = "Servicio", + .ClaveUnidad = "E48", + .ClaveProdServ = "78101802", + .Noidentificacion = "", + .CuentaPredial = ""} + + Timbre.Conceptos.Add(concepto) + + For Each drr As DataRow In Obj.DtDetalle.Rows + + If drr("PS").ToString.Length = 1 Then + tPS = drr("Obs").ToString + Else + If drr("PS").ToString.Length = 0 Then + tPS = "" + Else + tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) + End If + End If + Dim conceptoCarta As New CFDICartaPorteMercancia With { + .BienesTransp = drr("SATClaveProdServ").ToString, + .ClaveSTCC = "", 'para metodo ferroviario + .Cantidad = drr("Cantidad").ToString.ToDecimal, + .Descripción = tPS, + .ClaveUnidad = drr("SATClaveUM").ToString, + .Unidad = drr("UM").ToString, + .Dimensiones = "", + .PesoenKg = drr("PesoKg").ToString.ToDecimal, + .MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", "No"), + .ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString, + .Embalaje = drr("ClaveEmbalaje").ToString, + .DescripEmbalaje = drr("Embalaje").ToString, + .ValorMercancia = drr("PU").ToString.ToDecimal, + .Moneda = "MXN", 'temporal + .FraccionArrancelaria = "", + .UUIDComercioExt = "" + } + + Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal} + conceptoCarta.DetalleMercancia = DetalleMercancia + + Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"} + conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta) + + totSubTotal = totSubTotal - concepto.Importe + CartaPorte.Mercancias.Mercancias.Add(conceptoCarta) + + i += 1 + Next + Timbre.Complementos.CartaPorte = CartaPorte + + Else + '' T R A S L A D O S + + 'DETALLES + If Obj.DtDetalle IsNot Nothing Then + For Each drr As DataRow In Obj.DtDetalle.Rows + + If drr("PS").ToString.Length = 1 Then + tPS = drr("Obs").ToString + Else + If drr("PS").ToString.Length = 0 Then + tPS = "" + Else + tPS = String.Format("{0} {1}", drr("PS"), drr("Obs")) + End If + End If + + 'CONDICIONANTE, ESPECIAL + If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO + + Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal, + .Descripcion = tPS, + .ValorUnitario = drr("PU").ToString.ToDecimal, + .Importe = drr("TotalImporte").ToString.ToDecimal, + .Descuento = drr("Descuento").ToString.ToDecimal, + .Unidad = drr("UM").ToString, + .ClaveUnidad = drr("SATClaveUM").ToString, + .ClaveProdServ = drr("SATClaveProdServ").ToString, + .Noidentificacion = drr("Noidentificacion").ToString, + .CuentaPredial = drr("CuentaPredial").ToString} + 'VERIFICA SUMA SUBTOTALES + If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES + concepto.Importe = totSubTotal + End If + totSubTotal = totSubTotal - concepto.Importe + + 'SIEMPRE ESTAMOS AGREGANDO EL IVA + 'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal}) + + Timbre.Conceptos.Add(concepto) + i += 1 + Next + End If + + End If + + Else + TieneError = True + _MsgError.AppendLine("Consultar datos de timbrado") + End If + + ObjGrales.Dispose() + + End If + Return Timbre + End Function + Public Function Timbrar() As Boolean + + Dim Respuesta As Boolean = False + + Dim ObjTimbrado As New Timbrado + + If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then + Respuesta = True + Else + Respuesta = False + _MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI) + End If + + Return Respuesta + + End Function + + +End Class diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 4c8ad31ac..281f03674 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -116,7 +116,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Case "sendMailLPM" context.Response.Write(sendMailLPM(context)) Case "getSATColomias" - getSatColonias(context) + getSATColonias(context) + Case "GetFilesDirectory" + GetFilesDirectory(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -1359,6 +1361,30 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState #End Region + Private Function GetFilesDirectory(ByVal context As HttpContext) As String + Dim retorno As String = "" + Dim urlhost As String = context.Request.Url.Host.ToUpper() + If (urlhost = "LOCALHOST") Then + Dim directorio As String = IfNull(context.Request("directorio"), "").ToString() + + Dim xmlarchivos As System.Xml.Linq.XDocument = New System.Xml.Linq.XDocument() + Dim xfolder As XElement = New XElement("folder") + For Each urfile In System.IO.Directory.GetFiles(directorio) + Dim xfile As New XElement("archivo", urfile) + xfile.SetAttributeValue("EXT", Path.GetExtension(urfile)) + xfolder.Add(xfile) + + Next + xmlarchivos.Add(xfolder) + retorno = xmlarchivos.ToString() + context.Response.ContentType = "application/xml" + context.Response.Write(retorno) + context.Response.StatusCode = 200 + Else + context.Response.StatusCode = 500 + End If + Return retorno + End Function #Region "Get SAT Colonmias" Private Function getSATColonias(ByVal context As HttpContext) As String diff --git a/Bancos/PopIEVentas.aspx b/Bancos/PopIEVentas.aspx index d3cfbc3b7..f42d31759 100644 --- a/Bancos/PopIEVentas.aspx +++ b/Bancos/PopIEVentas.aspx @@ -60,7 +60,7 @@ F y E Ingresos X Comprobar Deudores - Compras + Compras diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 87c387537..0467778a7 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -785,11 +785,25 @@ Partial Class Bancos_PopIEVentas End If If RFCCliente.ToUpper <> "XAXX010101000" Then - Dim ObjCompras As New ClsCompras - If ObjCompras.GetCompras(-1, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, ProveedorRFC:=RFCCliente) Then - RBLContado.Items(4).Enabled = True + Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero + + If CveProveedor > 0 Then + Dim Mov As New ClsMovimientos + If Mov.GetCxPProveedor(CveProveedor, MinFecha.ToShortDateString, MaxFecha.ToShortDateString, -1, -1, -1, -1, -1, 1, -1, -1, "-1", "-1", "-1") Then + If Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio").Rows.Count > 0 Then + RBLContado.Items(4).Enabled = True + End If + End If + + Mov.Dispose() End If - ObjCompras.Dispose() + + + 'Dim ObjCompras As New ClsCompras + 'If ObjCompras.GetCompras(-1, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, ProveedorRFC:=RFCCliente) Then + ' RBLContado.Items(4).Enabled = True + 'End If + 'ObjCompras.Dispose() End If If Not Validada Then @@ -926,6 +940,9 @@ Partial Class Bancos_PopIEVentas End Sub Protected Sub CargaCompras(Optional CveMoneda As Integer = 1) + + If RFCCliente = "XAXX010101000" Then Exit Sub + Dim ObjCompras As New ClsCompras Dim ObjProveedor As New ClsCompProveedores Dim CveProveedor As Integer = -1 diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index c1d9e7fa4..9ccff8cbe 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 1e9d428eb..167e85864 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -931,8 +931,8 @@ Partial Class PopUpVerFactura Dim TransporteInternacional As String = "" Dim PermisoSTCC As String = "" Dim NumPermiso As String = "" - Dim Aseguradora As String = "" - Dim NumPolizaSeguro As String = "" + Dim AseguradoraRespCivil As String = "" + Dim NumPolizaSeguroRespCivil As String = "" Dim NombreAseguradoraMedioAmbiente As String = "" Dim NumPolizaSeguroMedioAmbiente As String = "" Dim NombreAseguradoraCarga As String = "" @@ -951,15 +951,17 @@ Partial Class PopUpVerFactura Dim FechaCertificacion As DateTime = Nothing Dim SelloCFDi As String = "" Dim SelloSAT As String = "" + Dim TipoDocto As String = "" Dim ObjInv As New ClsGenerales - If ObjInv.GetGralTimbre(CveTimbre, "-1", "-1", -1, MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then + If ObjInv.GetGralTimbre(CveTimbre, "-1", MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then If ObjInv.DtResultados.Rows.Count > 0 Then Dim Dr As DataRow = ObjInv.DtResultados.Rows(0) If Dr IsNot Nothing Then SerieFolio = Dr("SerieFolio").ToString - Telefono = Dr("Telefono").ToString + Telefono = Dr("FiguraTelefono").ToString + TipoDocto = Dr("TipoDocto").ToString End If End If End If @@ -974,13 +976,11 @@ Partial Class PopUpVerFactura Dim DtUbicaciones As New DataTable() DtUbicaciones.Columns.Add(New DataColumn("Distancia", GetType(String))) + DtUbicaciones.Columns.Add(New DataColumn("TipoUbicacion", GetType(String))) DtUbicaciones.Columns.Add(New DataColumn("RFC", GetType(String))) DtUbicaciones.Columns.Add(New DataColumn("Nombre", GetType(String))) DtUbicaciones.Columns.Add(New DataColumn("FechaHoraSalida", GetType(DateTime))) DtUbicaciones.Columns.Add(New DataColumn("Direccion", GetType(String))) - DtUbicaciones.Columns.Add(New DataColumn("TipoUbicacion", GetType(String))) - - Dim DtMercancias As New DataTable() DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) @@ -994,7 +994,7 @@ Partial Class PopUpVerFactura DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String))) Dim XMLDoc As New XmlDocument - Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", "Tra", String.Format("{0}", SerieFolio), "xml") + Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml") Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then @@ -1028,6 +1028,7 @@ Partial Class PopUpVerFactura namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal") namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal") namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte") + namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20") Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces) If nodeComprobante IsNot Nothing Then @@ -1064,41 +1065,42 @@ Partial Class PopUpVerFactura Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces) - Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte"), namespaces) + Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces) If nodeCartaPorte IsNot Nothing Then TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "") End If - Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:AutotransporteFederal", "cartaporte"), namespaces) + Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Autotransporte", "cartaporte20"), namespaces) If nodeAutotransporteFederal IsNot Nothing Then PermisoSTCC = ValorXML(nodeAutotransporteFederal, "PermSCT", "") NumPermiso = ValorXML(nodeAutotransporteFederal, "NumPermisoSCT", "") - Aseguradora = ValorXML(nodeAutotransporteFederal, "NombreAseg", "") - NumPolizaSeguro = ValorXML(nodeAutotransporteFederal, "NumPolizaSeguro", "") - - 'Por Definir de donde sale - 'NombreAseguradoraMedioAmbiente = ValorXML(nodeAutotransporteFederal, "", "") - 'NumPolizaSeguroMedioAmbiente = ValorXML(nodeAutotransporteFederal, "", "") - 'NombreAseguradoraCarga = ValorXML(nodeAutotransporteFederal, "", "") - 'NumPolizaSeguroCarga = ValorXML(nodeAutotransporteFederal, "", "") - - - End If - Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte"), namespaces) + Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte20"), namespaces) If nodeIdentificacionVehicular IsNot Nothing Then PlacaVM = ValorXML(nodeIdentificacionVehicular, "PlacaVM", "") AnioModeloVM = ValorXML(nodeIdentificacionVehicular, "AnioModeloVM", "") End If - Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte"), namespaces) - If nodeFiguraTransporte IsNot Nothing Then - Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "CveTransporte", "") - MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString()) + Dim nodeSeguros As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Seguros", "cartaporte20"), namespaces) + If nodeIdentificacionVehicular IsNot Nothing Then + AseguradoraRespCivil = ValorXML(nodeSeguros, "AseguraRespCivil", "") + NumPolizaSeguroRespCivil = ValorXML(nodeSeguros, "PolizaRespCivil", "") + + 'Por Definir de donde sale + NombreAseguradoraMedioAmbiente = ValorXML(nodeSeguros, "AseguraMedAmbiente", "") + NumPolizaSeguroMedioAmbiente = ValorXML(nodeSeguros, "PolizaMedAmbiente", "") + NombreAseguradoraCarga = ValorXML(nodeSeguros, "AseguraCarga", "") + NumPolizaSeguroCarga = ValorXML(nodeSeguros, "PolizaCarga", "") End If - Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte"), namespaces) + 'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces) + 'If nodeFiguraTransporte IsNot Nothing Then + ' Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "TipoFigura", "") + ' MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString()) + 'End If + + Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte20"), namespaces) For Each node As XmlNode In nodeMercancias Dim Row As DataRow = DtMercancias.NewRow @@ -1110,51 +1112,44 @@ Partial Class PopUpVerFactura DtMercancias.Rows.Add(Row) Next - Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Operador", "cartaporte"), namespaces) + Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:TiposFigura", "cartaporte20"), namespaces) For Each node As XmlNode In nodeOperadores Dim Row As DataRow = DtOperadores.NewRow - Row("RFC") = ValorXML(node, "RFCOperador", "") + Row("RFC") = ValorXML(node, "RFCFigura", "") Row("NumLicencia") = ValorXML(node, "NumLicencia", "") - Row("NombreOperador") = ValorXML(node, "NombreOperador", "") + Row("NombreOperador") = ValorXML(node, "NombreFigura", "") DtOperadores.Rows.Add(Row) Next - Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte"), namespaces) + Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte20"), namespaces) For Each node As XmlNode In nodeUbicaciones Dim Row As DataRow = DtUbicaciones.NewRow Row("Distancia") = ValorXML(node, "DistanciaRecorrida", "") - Dim nodeOrigen = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Origen") - If nodeOrigen IsNot Nothing Then - Row("RFC") = ValorXML(nodeOrigen, "RFCRemitente", "") - Row("Nombre") = ValorXML(nodeOrigen, "NombreRemitente", "") - Row("FechaHoraSalida") = ValorXML(nodeOrigen, "FechaHoraSalida", "").ToDateTime() + Row("TipoUbicacion") = ValorXML(node, "TipoUbicacion", "") + Row("FechaHoraSalida") = ValorXML(node, "FechaHoraSalidaLlegada", "") + Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "") + Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "") - Row("TipoUbicacion") = "" 'Sin definir - - - - End If - - Dim nodeDestino = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Destino") 'node.SelectSingleNode(String.Format("//{0}:Destino", "cartaporte"), namespaces) - If nodeDestino IsNot Nothing Then - Row("RFC") = ValorXML(nodeDestino, "RFCDestinatario", "") - Row("Nombre") = ValorXML(nodeDestino, "NombreDestinatario", "") - Row("FechaHoraSalida") = ValorXML(nodeDestino, "FechaHoraProgLlegada", "").ToDateTime() - Row("TipoUbicacion") = "" 'Sin definir - End If - - Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) + Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces) If nodeDomicilio IsNot Nothing Then + + Dim Estado As String = "" + Dim Municipio As String = "" + Dim Colonia As String = "" Dim calle = ValorXML(nodeDomicilio, "Calle", "") - Dim Estado = ValorXML(nodeDomicilio, "Estado", "") - Dim Pais = ValorXML(nodeDomicilio, "MEX", "") Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "") - Row("Direccion") = String.Format("{0} ,{1},{2}. CP {3}", calle, Estado, Pais, CP) + Dim dr As DataRow = GlobalDTGralColonias(ValorXML(nodeDomicilio, "Estado", ""), ValorXML(nodeDomicilio, "Municipio", ""), ValorXML(nodeDomicilio, "Colonia", "")).FiltroPrimero("") + If dr IsNot Nothing Then + Estado = dr("NombreEstado").ToString + Municipio = dr("NombreMunicipio").ToString + Colonia = dr("NombreAsentamiento").ToString + End If + Row("Direccion") = String.Format("{0} Col.{1},{2},{3}. CP {4}", calle, Colonia, Municipio, Estado, CP) End If @@ -1210,8 +1205,8 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("PermisoSTCC", PermisoSTCC)) params.Add(New ReportParameter("NumPermiso", NumPermiso)) - params.Add(New ReportParameter("Aseguradora", Aseguradora)) - params.Add(New ReportParameter("NumPoliza", NumPolizaSeguro)) + params.Add(New ReportParameter("Aseguradora", AseguradoraRespCivil)) + params.Add(New ReportParameter("NumPoliza", NumPolizaSeguroRespCivil)) params.Add(New ReportParameter("NombreAseguradoraMedioAmbiente", NombreAseguradoraMedioAmbiente)) params.Add(New ReportParameter("NumPolizaSeguroMedioAmbiente", NumPolizaSeguroMedioAmbiente)) @@ -1262,7 +1257,7 @@ Partial Class PopUpVerFactura rds4.Value = DtOperadores lrds.Add(rds4) - ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString)) + ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, SerieFolio) End If End If End Sub @@ -1272,7 +1267,7 @@ Partial Class PopUpVerFactura #Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO" Private Sub DescargaXMLTraslado(Parametros As Hashtable) - If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then + If Parametros("TIPODOCTO") IsNot Nothing AndAlso Parametros("TIPODOCTO").ToString <> "" Then Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf") Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten) Dim Archivo As New System.IO.FileInfo(Path) @@ -1296,16 +1291,19 @@ Partial Class PopUpVerFactura #Region "OP = 'DesPdfTra' - IMPRIME PDF TRASLADO" Private Sub DescargaPDFTraslado(Parametros As Hashtable) - If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then + If Parametros("TIPODOCTO") IsNot Nothing AndAlso Parametros("TIPODOCTO").ToString <> "" Then Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf") Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten) Dim Archivo As New System.IO.FileInfo(Path) + Dim cvetimbre As Integer = Parametros("CVETIMBRE").ToString.ToEntero If Archivo.Exists Then DescargarArchivoPDFTraslado(Archivo, Path) Else If Exten = "pdf" Then - GeneraPDFFactura(Parametros("CVEMOVIMIENTO").ToString.ToEntero) + Dim ObjTimbres As New Timbres("Rec", cvetimbre, UsuarioActual) + + GeneraPDFFactura(ObjTimbres.ObjFactura) Archivo = New System.IO.FileInfo(Path) If Archivo.Exists Then DescargarArchivoPDFTraslado(Archivo, Path) @@ -1318,7 +1316,7 @@ Partial Class PopUpVerFactura Private Sub DescargarArchivoPDFTraslado(Archivo As System.IO.FileInfo, path As String) HttpContext.Current.Response.Clear() HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf") + HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "text/xml", "application/pdf") HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) HttpContext.Current.Response.TransmitFile(path) @@ -1326,12 +1324,12 @@ Partial Class PopUpVerFactura HttpContext.Current.Response.End() End Sub - Private Sub GeneraPDFFactura(CveMovimiento As Integer) + Private Sub GeneraPDFFactura(ObjFactura As Modelos.Factura) Try - Dim objFactura = CreaObjetosTraslado(CveMovimiento) - If objFactura IsNot Nothing Then - PdfFactura(objFactura) - objFactura.Dispose() + ' Dim objFactura = CreaObjetosTraslado(CveMovimiento) + If ObjFactura IsNot Nothing Then + PdfFactura(ObjFactura) + ObjFactura.Dispose() End If Catch ex As Exception OnError("Ocurrió un error al generar el PDF", ex) diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 0d721b704..8763f2b39 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -1482,7 +1482,7 @@ Partial Class Compras_Proveedores DdlCveClasificacionProveedor.Items.Insert(0, New ListItem("Sin Clasificación", "0")) End Sub Private Sub CargaDIOTPais() - DdlDIOTPais.DataSource = GlobalDTPais() + DdlDIOTPais.DataSource = GlobalDTGralPaises() DdlDIOTPais.DataBind() DdlDIOTPais.Items.Insert(0, New ListItem("-", "0")) End Sub diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index 648e85ef5..9796dade0 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -217,7 +217,7 @@ - + diff --git a/Contabilidad/RepIVA.aspx.cs b/Contabilidad/RepIVA.aspx.cs index 075d299bf..94263da4f 100644 --- a/Contabilidad/RepIVA.aspx.cs +++ b/Contabilidad/RepIVA.aspx.cs @@ -104,7 +104,7 @@ public partial class Contabilidad_RepIVA : ClsPaginas LblMsgAcreditable.Text = "La información presenta importes en negativo, estos no se incluirán en el archivo generado para DIOT"; } - GvA.Columns[10].Visible = DtIVAAcreditable.SUM("IvaExentoImpo") > 0; // sino tiene valor la columna de importación de oculta + GvA.Columns[11].Visible = DtIVAAcreditable.SUM("valorActosImp1516") > 0; // sino tiene valor la columna de importación de oculta if (ObjCont.GetRepIVAAcumulado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), Conciliado, 3, DdlCuenta.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) diff --git a/Content/AjaxControlToolkit/Styles/Tabs.css b/Content/AjaxControlToolkit/Styles/Tabs.css index 8151906c9..5908a0886 100644 --- a/Content/AjaxControlToolkit/Styles/Tabs.css +++ b/Content/AjaxControlToolkit/Styles/Tabs.css @@ -86,7 +86,7 @@ border: 1px solid #999999; border-top: 0; font-family: verdana,tahoma,helvetica; - font-size: 10pt; + font-size: 12px; padding: 8px; } diff --git a/Content/AjaxControlToolkit/Styles/Tabs.min.css b/Content/AjaxControlToolkit/Styles/Tabs.min.css index f6666f315..7eaf91406 100644 --- a/Content/AjaxControlToolkit/Styles/Tabs.min.css +++ b/Content/AjaxControlToolkit/Styles/Tabs.min.css @@ -1 +1 @@ -.ajax__tab_default .ajax__tab_header{white-space:normal !important}.ajax__tab_default .ajax__tab_outer{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_inner{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_tab{display:inline-block;display:-moz-inline-box;overflow:hidden;text-align:center}.ajax__tab_xp .ajax__tab_disabled{color:#a0a0a0;cursor:default}.ajax__tab_xp .ajax__tab_header{background-position:bottom;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px;height:21px}.ajax__tab_xp .ajax__tab_header .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body{background-color:#fff;border:1px solid #999;border-top:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalleft{background-position:right;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active:not(:first-child){margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalleft{background-color:#fff;border:1px solid #999;border-left:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalright{background-position:left;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active{margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalright{background-color:#fff;border:1px solid #999;border-right:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_bottom{background-position:top;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab{background-repeat:repeat-x;height:17px;margin:0;padding:0 4px 4px 4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_bottom{background-color:#fff;border:1px solid #999;border-bottom:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__scroll_horiz{overflow-x:scroll}.ajax__scroll_vert{overflow-y:scroll}.ajax__scroll_both{overflow:scroll}.ajax__scroll_auto{overflow:auto}.ajax__scroll_none{overflow:hidden}.ajax__tab_plain .ajax__tab_outer{border:2px solid #999;text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_inner{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_body{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_header{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_active .ajax__tab_outer{background:#ffffe1} \ No newline at end of file +.ajax__tab_default .ajax__tab_header{white-space:normal !important}.ajax__tab_default .ajax__tab_outer{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_inner{display:inline-block;display:-moz-inline-box}.ajax__tab_default .ajax__tab_tab{display:inline-block;display:-moz-inline-box;overflow:hidden;text-align:center}.ajax__tab_xp .ajax__tab_disabled{color:#a0a0a0;cursor:default}.ajax__tab_xp .ajax__tab_header{background-position:bottom;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px;height:21px}.ajax__tab_xp .ajax__tab_header .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body{background-color:#fff;border:1px solid #999;border-top:0;font-family:verdana,tahoma,helvetica;font-size:12px;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalleft{background-position:right;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active:not(:first-child){margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalleft .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalleft{background-color:#fff;border:1px solid #999;border-left:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_verticalright{background-position:left;background-repeat:repeat-y;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_tab{background-repeat:repeat-x;margin:0;padding:4px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active{margin-top:1px}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_verticalright .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_verticalright{background-color:#fff;border:1px solid #999;border-right:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__tab_xp .ajax__tab_header_bottom{background-position:top;background-repeat:repeat-x;font-family:verdana,tahoma,helvetica;font-size:11px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_outer{background-position:right;background-repeat:no-repeat;height:21px;padding-right:4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_inner{background-repeat:no-repeat;padding-left:3px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_tab{background-repeat:repeat-x;height:17px;margin:0;padding:0 4px 4px 4px}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_outer{background-position:right;background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_inner{background-repeat:no-repeat;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_hover .ajax__tab_tab{background-repeat:repeat-x;cursor:pointer}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_outer{background-position:right;background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_inner{background-repeat:no-repeat}.ajax__tab_xp .ajax__tab_header_bottom .ajax__tab_active .ajax__tab_tab{background-repeat:repeat-x}.ajax__tab_xp .ajax__tab_body_bottom{background-color:#fff;border:1px solid #999;border-bottom:0;font-family:verdana,tahoma,helvetica;font-size:10pt;padding:8px}.ajax__scroll_horiz{overflow-x:scroll}.ajax__scroll_vert{overflow-y:scroll}.ajax__scroll_both{overflow:scroll}.ajax__scroll_auto{overflow:auto}.ajax__scroll_none{overflow:hidden}.ajax__tab_plain .ajax__tab_outer{border:2px solid #999;text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_inner{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_body{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_header{text-align:center;vertical-align:middle}.ajax__tab_plain .ajax__tab_active .ajax__tab_outer{background:#ffffe1} \ No newline at end of file diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 02127071e..5c84bf091 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -2754,7 +2754,7 @@ Partial Class Contratos_Default Private Sub CargaGVGastos() Dim objContrato As New ClsContratos - If objContrato.GetContratoGastos(CveContrato) Then + If objContrato.GetContratoGastos(CveContrato, UsuarioActual.cveempresa) Then DtGastos = objContrato.DtResultados GvContratosGastos.DataSource = DtGastos SumaGasto = objContrato.DtResultados.SUM("Importe", "CveContratoGasto IS NULL") diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 48783158d..c920c753a 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -2808,7 +2808,7 @@ Partial Class Contratos_ContratoObra Private Sub CargaGVGastos() Dim objContrato As New ClsContratos - If objContrato.GetContratoGastos(CveContrato) Then + If objContrato.GetContratoGastos(CveContrato, UsuarioActual.CveEmpresa) Then DtGastos = objContrato.DtResultados GvContratosGastos.DataSource = DtGastos SumaGasto = objContrato.DtResultados.SUM("Importe", "CveContratoGasto IS NULL") diff --git a/Documentacion/TableroMaterialidad.aspx b/Documentacion/TableroMaterialidad.aspx new file mode 100644 index 000000000..967e0483e --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx @@ -0,0 +1,266 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TableroMaterialidad.aspx.cs" Inherits="Documentacion_TableroMaterialidad" %> + + + + + + + + Materialidad + + + + + + +
  • + Cargar Doctos + <%--Cargar Doctos--%> +
  • +
  • + Cargar XML PDF + <%--Cargar XML PDF--%> +
  • +
    +
    +
    + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    Año:
    +
    + +
    + +
    Mes:
    +
    + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    + +
    + + + + + + + + + + + + + <%-- + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Cliente<%# DataBinder.Eval(Container.DataItem, "Documentacion") %>
    <%# String.Format("{0:dd/MM/yyyy} - {1:dd/MM/yyyy}", DataBinder.Eval(Container.DataItem, "InicioPeriodo"), DataBinder.Eval(Container.DataItem, "FinPeriodo")) %> <%# DataBinder.Eval(Container.DataItem, "Antiguedad") %> <%# DataBinder.Eval(Container.DataItem, "DiasVacaciones") %> <%# DataBinder.Eval(Container.DataItem, "Dias") %> <%# DataBinder.Eval(Container.DataItem, "DiasDisfrutados") %> <%# DataBinder.Eval(Container.DataItem, "DiasPrima") %>
    XML TimbradosPDF Timbrados
    <%# DataBinder.Eval(Container.DataItem, "NombreComercial") %><%# + DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="-1" ? "N/A": + string.Format("{0}", + (DataBinder.Eval( ((RepeaterItem)Container.Parent.Parent).DataItem ,string.Format("V_{0}",DataBinder.Eval(Container.DataItem, "CveDocumentacion"))).ToString() =="0"? + + + "No": + + + "Si") + + ,DataBinder.Eval(Container.DataItem, "CveDocumentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "CveCliente") + ,DataBinder.Eval(Container.DataItem, "Documentacion"),DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "NombreComercial") + ) + + + %> + <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalXML"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%# string.Format("{1}/{0}",DataBinder.Eval(Container.DataItem, "Personal"),DataBinder.Eval(Container.DataItem, "PersonalPDF"),DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> + + <%# string.Format("Enviar",DataBinder.Eval(Container.DataItem, "CveCliente"),anio,mes) %> +
    + + + + + + +
    +
    +
    + + + + diff --git a/Documentacion/TableroMaterialidad.aspx.cs b/Documentacion/TableroMaterialidad.aspx.cs new file mode 100644 index 000000000..85549a974 --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx.cs @@ -0,0 +1,97 @@ +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 Extensiones; + +public partial class Documentacion_TableroMaterialidad :ClsPaginas +{ + #region "Propiedades" + + public int anio + { + get { return ViewState["anio"] != null ? ViewState["anio"].ToString().ToEntero() : 0; } + set { ViewState["anio"] = value; } + } + public int mes + { + get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; } + set { ViewState["mes"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + cargadatos(); + } + } + DataTable dt; + public void cargadatos() + { + using (ClsEdocumentacion edoc = new ClsEdocumentacion()) + { + if(edoc.TableroMaterialidadGET(UsuarioActual.CveEmpresa,(anio= Txtanio.Text.ToEntero()), (mes= ddlMes.SelectedValue.ToEntero())) && edoc.DSResultados.Tables.Count >1) + { + RptDatos.DataSource = edoc.DSResultados.Tables[0]; + dt = edoc.DSResultados.Tables[1]; + RPTTableroHeader.DataSource = edoc.DSResultados.Tables[1]; + RPTTableroHeader.DataBind(); + RptDatos.DataBind(); + DdlDocumentacion.DataSource = dt; + DdlDocumentacion.DataBind(); + + } + + } + } + + protected void RptDatos_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + DataRowView item = (DataRowView)(e.Item.DataItem); + Repeater rpt =((Repeater)e.Item.FindControl("rptdocumentacion")); + rpt.DataSource = dt; + rpt.DataBind(); + } + + + + protected void BtnAddClienteDocumento_Click(object sender, EventArgs e) + { + + } + + protected void BtnEnviarDoctos_Click(object sender, EventArgs e) + { + Alert("El correo se ha enviado."); + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargadatos(); + } + + protected void BtnAddClienteDocumentoxmlpd_Click(object sender, EventArgs e) + { + + } + + protected void LckOpModalDoctos_Click(object sender, EventArgs e) + { + DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime(); + LtlPeriodo.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX"));//string.Format(""); + UpModalDoctos.Update(); + RegistraScript("$('#ModalDoctos').modal();"); + } + + protected void LckOpModalDoctosPDFXML_Click(object sender, EventArgs e) + { + DateTime fecha = string.Format("{0}-{1}-01", anio, mes).ToDateTime(); + LtlPeriodoXMLPDF.Text = fecha.ToString("MMMM yyyy", System.Globalization.CultureInfo.CreateSpecificCulture("es-MX")); + RegistraScript("$('#ModalDoctos').modal();"); + Upxmlpdf.Update(); + } +} \ No newline at end of file diff --git a/Documentacion/TableroMaterialidadDetalle.aspx b/Documentacion/TableroMaterialidadDetalle.aspx new file mode 100644 index 000000000..1f5d39474 --- /dev/null +++ b/Documentacion/TableroMaterialidadDetalle.aspx @@ -0,0 +1,114 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TableroMaterialidadDetalle.aspx.cs" Inherits="Documentacion_TableroMaterialidadDetalle" %> + + + + + + + + + Materialidad personal + + + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    Cliente:
    +
    + +
    +
    Año:
    +
    + +
    +
    MES:
    +
    + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + diff --git a/Documentacion/TableroMaterialidadDetalle.aspx.cs b/Documentacion/TableroMaterialidadDetalle.aspx.cs new file mode 100644 index 000000000..450e86419 --- /dev/null +++ b/Documentacion/TableroMaterialidadDetalle.aspx.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Documentacion_TableroMaterialidadDetalle : ClsPaginas +{ + #region "Propiedades" + public int CveCliente + { + get { return ViewState["CveCliente"] != null ? ViewState["CveCliente"].ToString().ToEntero() : 0; } + set { ViewState["CveCliente"] = value; } + } + + public int anio + { + get { return ViewState["anio"] != null ? ViewState["anio"].ToString().ToEntero() : 0; } + set { ViewState["anio"] = value; } + } + public int mes + { + get { return ViewState["mes"] != null ? ViewState["mes"].ToString().ToEntero() : 0; } + set { ViewState["mes"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + if (Request["CveCliente"] != null && Request["CveCliente"].ToString().ToEntero() > 0) + { + CveCliente = Request["CveCliente"].ToString().ToEntero(); + DdlCliente.SelectedValue = CveCliente.ToString(); + } + if (Request["anio"] != null && Request["anio"].ToString().ToEntero() > 0) + { + anio = Request["anio"].ToString().ToEntero(); + Txtanio.Text = anio.ToString(); + } + if (Request["mes"] != null && Request["mes"].ToString().ToEntero() > 0) + { + mes = Request["mes"].ToString().ToEntero(); + ddlMes.SelectedValueExist(mes.ToString()); + } + cargadatos(); + } + } + public void cargadatos() + { + using (ClsEdocumentacion edoc = new ClsEdocumentacion()) + { + if (edoc.TableroMaterialidadDetalleGET(UsuarioActual.CveEmpresa, (anio = Txtanio.Text.ToEntero()), (mes = ddlMes.SelectedValue.ToEntero()), CveCliente) && edoc.DSResultados.Tables.Count > 0) + { + GVData.DataSource = edoc.DSResultados.Tables[0]; + GVData.DataBind(); + + } + + } + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + cargadatos(); + } +} \ No newline at end of file diff --git a/General/CATIEPSxEntidadFed.aspx.cs b/General/CATIEPSxEntidadFed.aspx.cs index f7b1f8390..bf502cc9e 100644 --- a/General/CATIEPSxEntidadFed.aspx.cs +++ b/General/CATIEPSxEntidadFed.aspx.cs @@ -45,8 +45,7 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas { if (!IsPostBack) { - - DdlEstado.DataSource = get_GlobalDTEstado("Mex"); + DdlEstado.DataSource = get_GlobalDTGralEstados("MEX"); DdlEstado.DataBind(); diff --git a/General/RepEntregaAlmacenRuta.aspx b/General/RepEntregaAlmacenRuta.aspx index 522992dcc..f177f0868 100644 --- a/General/RepEntregaAlmacenRuta.aspx +++ b/General/RepEntregaAlmacenRuta.aspx @@ -99,7 +99,7 @@ " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> @@ -111,8 +111,7 @@
    - - + @@ -125,7 +124,7 @@ - + @@ -147,8 +146,7 @@ -