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/Acumuladores/RepIndicadorDiario.aspx.vb b/Acumuladores/RepIndicadorDiario.aspx.vb index 31156c0e1..74b9e0cf3 100644 --- a/Acumuladores/RepIndicadorDiario.aspx.vb +++ b/Acumuladores/RepIndicadorDiario.aspx.vb @@ -178,27 +178,18 @@ Partial Class ACumuladores_RepIndicadorDiario Dim FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) Dim FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) - - Dim FechaIn As String = $" Fecha Inicio: {txtFechaI.Text}" Dim FechaFn As String = $" Fecha Fin: {txtFechaF.Text}" If txtFechaI.Text = "" Then FechaIn = "" - If txtFechaF.Text = "" Then FechaFn = "" - - + If txtFechaF.Text = "" Then FechaFn = "" Dim SubProyecto = If(DdlSubProyecto.SelectedItem.Text = "", "", $" SubProyecto: {DdlSubProyecto.SelectedItem.Text}") - Dim FechaIF, FechaFF As String FechaIF = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1") FechaFF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1") - - If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then - - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index fd2700c84..68086bdba 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 = "" @@ -590,7 +590,7 @@ End Class Public Class CFDICartaPorteAutoTransporte - Public Property PermSCT As String = "" + Public Property PermisoSCT As String = "" Public Property NumPermisoSCT As String = "" Public Property NombreSeguroResponsabilidadCivil As String = "" Public Property PolizaSeguroResponsabilidadCivil 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/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 7c7e28372..7432b8d52 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -140,6 +140,24 @@ Public Class ClsClasificaciones Return Retorno End Function + Public Function GetClasificacion2ProductoServicio(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Clasificacion2ProductoServicioGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + OnError("Ocurrió un error al consultar las Clasificaciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetClasificacionesComprobaciones(CveEmpresa As Integer, Optional Opcion As Integer = 1, Optional TipoComprobacion As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 67381324c..40bcd70e1 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -675,8 +675,9 @@ Public Class ClsCompras End Function Public Function GetRepComprasAF(FechaI As String, FechaF As String, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Gpo As Integer, CveProyecto As Integer, CveSubProyecto As Integer, - TipoCambio As Integer, TCEspecifico As Double, CveClasificacion As Integer, CveActivoFijo As Integer, CveTipoActivoFijo As Integer, CveSubTipoActivoFijo As Integer, CvePS As Integer, Optional CveUsuarioConsulta As Integer = -1 - ) As Boolean + TipoCambio As Integer, TCEspecifico As Double, CveClasificacion As Integer, CveActivoFijo As Integer, CveTipoActivoFijo As Integer, CveSubTipoActivoFijo As Integer, CvePS As Integer, Optional CveUsuarioConsulta As Integer = -1, + Optional CveClasificacion2 As Integer = -1 + ) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasAFGetRep") @@ -697,6 +698,7 @@ Public Class ClsCompras .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 'CveClasificacion @@ -714,7 +716,7 @@ Public Class ClsCompras Public Function GetRepComprasAFDetalle(FechaI As String, FechaF As String, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Gpo As Integer, CveProyecto As Integer, CveSubProyecto As Integer, TipoCambio As Integer, TCEspecifico As Double, CveClasificacion As Integer, CveActivoFijo As Integer, CveTipoActivoFijo As Integer, CveSubTipoActivoFijo As Integer, CvePS As Integer, - Anio As Integer, Mes As Integer, AnioMes As String, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Anio As Integer, Mes As Integer, AnioMes As String, Optional CveUsuarioConsulta As Integer = -1, Optional CveClasificacion2 As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasAFDetalleGetRep") @@ -739,6 +741,7 @@ Public Class ClsCompras .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta + .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 'CveClasificacion End With 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/ClsGPS.vb b/App_Code/ClsGPS.vb index 21ddfea1e..4cdc9e7f2 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -781,7 +781,7 @@ Public Class ClsGPS Velocidad = Row("SPD").ToString.ToDouble Fecha = Row("FechaTrama").ToString KMRecorridos = Row("KMRecorridos").ToString.ToDouble - Info = InfoWindowReader($" Vehículo: {Vehiculo}", "-1", CveDispositivo, Row, TienePermisoComandos) + Info = InfoWindowReader($" Vehiculo: {Vehiculo}", "-1", CveDispositivo, Row, TienePermisoComandos) If Velocidad > 1 Then diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 005780993..f1c04e6e0 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 @@ -2736,7 +2736,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 @@ -2750,7 +2750,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 @@ -2764,7 +2764,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 @@ -2778,7 +2778,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 @@ -2791,7 +2791,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 @@ -2805,7 +2805,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 @@ -2819,7 +2819,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 @@ -2834,7 +2834,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 @@ -2850,7 +2850,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 @@ -2864,11 +2864,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) @@ -3633,8 +3635,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") @@ -3644,15 +3648,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 @@ -3674,15 +3676,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 @@ -3701,37 +3701,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 @@ -3778,22 +3790,28 @@ 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, + FolioReferencia As String, Referencia As String, FechaLimite As Date, 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("@FolioReferencia", SqlDbType.VarChar).Value = FolioReferencia + .Add("@Referencia", SqlDbType.VarChar).Value = Referencia + .Add("@FechaLimite", SqlDbType.DateTime).Value = FechaLimite .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Tipo", SqlDbType.VarChar).Value = Tipo .Add("@Estatus", SqlDbType.VarChar).Value = Estatus + .Add("@Distancia", SqlDbType.Int).Value = Distancia .Add("@CveEntregaAlmacen", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -3832,6 +3850,28 @@ Public Class ClsGenerales Return Retorno End Function + Public Function AsignaEntregaAlmacenRuta(CveCamion As Integer, CveChofer As Integer, FechaEntrega As Date, CveEntregaAlmacen As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_EntregaAlmacenRutaAsignar") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCamion", SqlDbType.Int).Value = CveCamion + .Add("@CveChofer", SqlDbType.Int).Value = CveChofer + .Add("@FechaEntrega", SqlDbType.DateTime).Value = FechaEntrega + .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen + .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 entrega almacen", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetInvEntregaAlmacenRuta(CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Opcion As Integer, Optional Estatus As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 54d9be053..92cd449be 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 @@ -2953,6 +2978,53 @@ Public Class ClsNominas End Function #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 PA_AGRO_Embarque_ManifiestoGet(cveSubproyecto As Int32, cveUsuario As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_AGRO_Embarque_ManifiestoGet", CommandType.StoredProcedure) + addParameters("@CveSubproyecto", SqlDbType.Int, cveSubproyecto) + addParameters("@CveUsuario", SqlDbType.Int, cveUsuario) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto) + retorno = RunQuery("Ocurrió un error al obtener el PA_AGRO_Embarque_ManifiestoGet.") + Return retorno + End Function + + Public Function PA_Agro_Embarque_PalletGet(cvePallet As Int32, cveCultivo As Int32, cveCultivoVariedad As Int32, cveEnvase As Int32, cveEtiqueta As Int32, cveEtiquetasporTarima As Int32, cveFormatoImpresion As Int32, cveTamaño As Int32, cveTipoTarima As Int32, cveEmpresa As Int32, cveEmbarqueManifiesto As Int32, cveTemporada As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Agro_Embarque_PalletGet", CommandType.StoredProcedure) + addParameters("@CvePallet", SqlDbType.Int, cvePallet) + addParameters("@CveCultivo", SqlDbType.Int, cveCultivo) + addParameters("@CveCultivoVariedad", SqlDbType.Int, cveCultivoVariedad) + addParameters("@CveEnvase", SqlDbType.Int, cveEnvase) + addParameters("@CveEtiqueta", SqlDbType.Int, cveEtiqueta) + addParameters("@CveEtiquetasporTarima", SqlDbType.Int, cveEtiquetasporTarima) + addParameters("@CveFormatoImpresion", SqlDbType.Int, cveFormatoImpresion) + addParameters("@CveTamaño", SqlDbType.Int, cveTamaño) + addParameters("@CveTipoTarima", SqlDbType.Int, cveTipoTarima) + addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa) + addParameters("@CveEmbarqueManifiesto", SqlDbType.Int, cveEmbarqueManifiesto) + addParameters("@CveTemporada", SqlDbType.Int, cveTemporada) + retorno = RunQuery("Ocurrió un error al obtener el PA_Agro_Embarque_PalletGet.") + Return retorno + End Function + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 48f1a2e9f..5dc4ae116 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -413,56 +413,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 @@ -507,26 +519,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 @@ -968,6 +988,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 @@ -1604,6 +1650,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) 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) @@ -1891,7 +1962,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 @@ -1905,6 +1976,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 @@ -2409,39 +2481,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 @@ -4944,14 +4983,8 @@ Public Class ClsPaginas PaginaDict.Add("/Inventarios/RepExistenciaLote.aspx".ToUpper(), 109) PaginaDict.Add("/Inventarios/CatUnidades.aspx".ToUpper(), 2056) - - - - 'PaginaDict.Add("/Inventarios/EntregasPorRealizarRuta.aspx".ToUpper(), -1) - 'PaginaDict.Add("/General/RepPaqueteriasGuiasRuta.aspx".ToUpper(), -1) - PaginaDict.Add("/Inventarios/EntregaAlmacenRuta.aspx".ToUpper(), 1320) - PaginaDict.Add("/General/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319) + PaginaDict.Add("/Inventarios/RepEntregaAlmacenRuta.aspx".ToUpper(), 1319) @@ -5189,6 +5222,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) @@ -6509,7 +6545,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 @@ -6740,7 +6776,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 @@ -6812,12 +6848,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") @@ -7117,7 +7150,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, ""))) @@ -7128,7 +7161,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 @@ -7289,7 +7322,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) @@ -7413,8 +7446,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 436328d6c..1f4db56e7 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6210,6 +6210,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 @@ -6279,7 +6280,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 @@ -6301,7 +6302,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 @@ -6437,24 +6439,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" @@ -6542,32 +6544,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 @@ -6575,15 +6576,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 = "" @@ -6681,28 +6682,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 @@ -6710,15 +6711,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) @@ -9702,21 +9703,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..c075709d5 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,22 +2154,24 @@ 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 If Carta.FiguraTransporte.AutoTransporte IsNot Nothing Then - cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT) + cfdi.CartaPorteAutotransporte(Carta.FiguraTransporte.AutoTransporte.PermisoSCT, Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT) cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM) @@ -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" @@ -3903,8 +3918,8 @@ Public Class Timbrado ComCartaPorte.FiguraTransporte.CveTransporte = ProfactCartaPorte.c_CveTransporte.Item02 ComCartaPorte.Mercancias.AutotransporteFederal = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederal - If Carta.FiguraTransporte.AutoTransporte.PermSCT <> "" Then - ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermSCT), ProfactCartaPorte.c_TipoPermiso) + If Carta.FiguraTransporte.AutoTransporte.PermisoSCT <> "" Then + ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporte.PermisoSCT), ProfactCartaPorte.c_TipoPermiso) End If ComCartaPorte.Mercancias.AutotransporteFederal.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporte.NumPermisoSCT 'pendiente RMF @@ -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..a8263dfde --- /dev/null +++ b/App_Code/Timbres.vb @@ -0,0 +1,364 @@ +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 drT("FolioFiscalRelacionado").ToString <> "" Then + + Timbre.CFDIRelacionados.TipoRelacion = "05" + Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString) + + End If + + 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.PermisoSCT = drT("ClaveTipoPermisoSCT").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 + + + 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 = drT("RemitenteRFC").ToString, + .FechaHoraSalidaLlegada = FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", + .NombreRemitenteDestinatario = drT("RemitenteNombre").ToString, + .Domicilio = DomOrigen} + CartaPorte.Ubicaciones.Add(Ubica) + Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString, + .FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"), + .NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString, + .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 = ""} + '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 + + Timbre.Conceptos.Add(concepto) + i += 1 + Next + Else + TieneError = True + _MsgError.AppendLine("timbrado son detalle de productos") + 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/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 63358b70f..bb6c90d07 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -3178,10 +3178,14 @@ Namespace Extensiones Public Sub SelectedValueExistInsert(Obj As DropDownList, Valor As Object, Texto As String) If (Obj.Items.FindByValue(Valor.ToString()) IsNot Nothing) Then - Obj.SelectedValue = Valor.ToString + Obj.SelectedValue = Valor.ToString() Else - Obj.Items.Insert(1, New ListItem(Texto, Valor.ToString)) - Obj.SelectedValue = Valor.ToString + If Obj.Items.Count > 0 Then + Obj.Items.Insert(1, New ListItem(Texto, Valor.ToString())) + Else + Obj.Items.Insert(0, New ListItem(Texto, Valor.ToString())) + End If + Obj.SelectedValue = Valor.ToString() End If End Sub diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index abe9f9840..a0b88fb36 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -6,6 +6,7 @@ Imports System.Data Imports Newtonsoft.Json Imports Extensiones Imports System.IO +Imports Microsoft.Reporting.WebForms Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState 'TEMPORAL, DEBE SER REEMPLAZADO POR EL MODELO DE LA LIBRERIA @@ -116,15 +117,166 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Case "sendMailLPM" context.Response.Write(sendMailLPM(context)) Case "getSATColomias" - getSATColonias(context) - - Case "cancelarRemision" + getSatColonias(context) + Case "GetFilesDirectory" + GetFilesDirectory(context) + Case "Getetiquetas" + Getetiquetas(context) + Case "cancelarRemision" cancelarRemision(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) End Try End Sub + + + Public Sub ImprimirPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing, Optional Content_Disposition As String = "attachment") + 'limpio ReportViwer + ImprimirbytesPDF(StreamPDF(RutaReporte, DataSource, Parametros, NombreArchivo, Formato, MR), NombreArchivo, Formato, Content_Disposition:=Content_Disposition) + End Sub + + Public Function StreamPDF(RutaReporte As String, DataSource As List(Of ReportDataSource), Parametros As List(Of ReportParameter), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional MR As ReportViewer = Nothing) As Byte() + 'limpio ReportViwer + Dim sw As New System.Diagnostics.Stopwatch() + sw.Start() + Dim Bytes As Byte() = Nothing + + Dim CveUsuario As Integer = 0 + Dim CveEmpresa As Integer = 0 + Dim RutaEmpresa As String = "" + + + Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) + + 'TOMAR LA RUTA BASE PARA EL DIRECTORIO DE LA EMPRESA + If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") Then + bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") + End If + + RutaReporte.Replace("/", "\") + + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then + RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) + End If + + If False Then + + Dim wsreport As New WSRDLC.WebServiceSoapClient + Dim params As New List(Of WSRDLC.ReportParameter) + Dim ds As New DataSet + For Each rpds As ReportDataSource In DataSource + Dim dt As DataTable = DirectCast(rpds.Value, Data.DataTable) + If dt Is Nothing Then + dt = New DataTable() + Else + dt = dt.Copy() + End If + dt.TableName = rpds.Name + ds.Tables.Add(dt) + Next + For Each rpds As ReportParameter In Parametros + Dim param As New WSRDLC.ReportParameter + param.Name = rpds.Name + param.Values = {rpds.Values(0)} + params.Add(param) + Next + Bytes = wsreport.StreamPDFBytes(RutaReporte, ds, params.ToArray(), NombreArchivo, Formato, CveEmpresa, CveUsuario) + wsreport = Nothing + params = Nothing + ds.Dispose() : ds = Nothing + Else + If IsNothing(MR) Then MR = New ReportViewer + Try + ' MasterReporteador.LocalReport.DataSources.Clear() + For Each RDS As ReportDataSource In DataSource + MR.LocalReport.DataSources.Add(RDS) + Next + + MR.LocalReport.ReportPath = RutaReporte + MR.ProcessingMode = ProcessingMode.Local + MR.LocalReport.EnableExternalImages = True + MR.LocalReport.SetParameters(Parametros) + MR.LocalReport.Refresh() + Dim Warnings As Warning() = Nothing + Dim StreamIds As String() = Nothing + Dim MimeType As String = Nothing + Dim Encoding As String = Nothing + Dim Extension As String = Nothing + Bytes = MR.LocalReport.Render(Formato, Nothing, MimeType, Encoding, Extension, StreamIds, Warnings) + Catch ex As Microsoft.Reporting.WebForms.ScriptManagerNotFoundException + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error: {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + Catch ex As Exception + GuardaLog($"Error: { If(ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, ex.Message) } | Descripcion: {If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException IsNot Nothing AndAlso ex.InnerException.InnerException.Message IsNot Nothing, ex.InnerException.InnerException.Message, If(ex.InnerException IsNot Nothing AndAlso ex.InnerException.Message IsNot Nothing, ex.InnerException.Message, "Sin descripcion"))} - Ruta {RutaReporte}") + 'HAY QUE VALIDAR QUE LOS OBJETOS QUE SE USAN PARA GUARDAR LOG EXISTEN!!! IPP 14 AGOSTO 2017 + 'GuardaLog($"Error {ex.InnerException.Message} | Descripcion: {If(ex.InnerException.InnerException IsNot Nothing, ex.InnerException.InnerException.Message, "Sin descripcion")} - Ruta {RutaReporte}") + End Try + MR.Dispose() + MR = Nothing + + End If + sw.Stop() + + If sw.Elapsed.TotalSeconds > 5 Then + GuardaLog($"Reporte:{RutaReporte} | Tiempo Renderizado Milisegundos: {sw.ElapsedMilliseconds},Total Segundos: {sw.Elapsed.TotalSeconds} ") + End If + + Return Bytes + End Function + + Public Sub ImprimirbytesPDF(bytes As Byte(), Optional NombreArchivo As String = "Reporte", Optional Formato As String = "PDF", Optional Descarga As Boolean = False, Optional Content_Disposition As String = "attachment") + 'limpio ReportViwer + Dim mimeType As String = Nothing + Dim extension As String = Nothing + + 'If Descarga Then + ' Try + ' bytes = bytes + ' File.WriteAllBytes(String.Format("{0}PDF/whatever.gif", UsuarioActual.Empresa.Ruta), img) + ' Catch ex As Exception + ' If UsuarioActual.CveRol = 1 Then + ' Alert(ex.Message, TipoMensaje.MsgAdvertencia) + ' Else + ' Alert("Ocurrió un error al generar la descarga. Favor de contactar a soporte tecnico cod'IMPDFclspag'", TipoMensaje.MsgAdvertencia) + ' End If + ' End Try + 'End If + + Try + bytes = bytes + Response.Buffer = True + Response.Clear() + Response.ContentType = mimeType + Response.AddHeader("content-disposition", String.Format("{0}; filename={1}.{2}", Content_Disposition, NombreArchivo, If(Formato = "PDF", "pdf", "xls"))) + Response.BinaryWrite(bytes) ' create the file + Response.Flush() ' send it to the client to download + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + HttpContext.Current.Response.End() + bytes = Nothing + Catch ex As Exception + + Alert("Ocurrió un error al generar la descarga. Favor de contactar a soporte tecnico cod:'IMPDFclspag'", TipoMensaje.MsgAdvertencia) + + End Try + End Sub + Dim Response As HttpResponse + Private Function Getetiquetas(context As HttpContext) As String + Dim retorno As String = "" + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Envase", "1 1/9")) + params.Add(New ReportParameter("Tamano", "Small")) + params.Add(New ReportParameter("Cultivo", "Tomate")) + params.Add(New ReportParameter("noPallet", "000001")) + Response = context.Response + Dim tablaReporte As New DataTable + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + ImprimirPDF("GPS/PalletEtiqueta.rdlc", (New List(Of ReportDataSource)), params, "Equipo GPS") + Return retorno + End Function Private Function GetTokenAngular(context As HttpContext) As String Dim usuario As Usuario = UsuarioActual(context) Dim tokenDescriptor = New Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor With { @@ -1362,6 +1514,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 @@ -1426,7 +1602,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End Function #End Region -#Region "Get SAT Colonmias" +#Region "C A N C E L A R - R E M I S I O N" Private Function cancelarRemision(ByVal context As HttpContext) As String Dim retorno As String = "" diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx index 6a8e7f9bd..704255414 100644 --- a/Bancos/IE.aspx +++ b/Bancos/IE.aspx @@ -123,20 +123,48 @@ + + +
+ + <%----%> +
+ +
-
+
-
+
+ +
+ T.C.: + + + + +
+ +
+ +
+
+ Dolares + + <%----%> + +
+ +
@@ -1781,5 +1809,10 @@ return false; } + function CambiaTCPagoOC() { + + $("#LnkActualizaTCOC").click(); + } + diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index fa4a59b34..f24961ea0 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -297,6 +297,17 @@ Partial Class Bancos_IE End Set End Property + + Private Property CveMonedaOriginal As Integer + Get + Return ViewState("CveMonedaOriginal").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveMonedaOriginal") = value + End Set + End Property + + Private Property CveOCSolicitudAnticipo As Integer Get @@ -504,6 +515,22 @@ Partial Class Bancos_IE End Set End Property + + Private Property ImporteOriginalDolaras As Decimal + Get + If ViewState("ImporteOriginalDolaras") Is Nothing Then + Return 0 + Else + Return ViewState("ImporteOriginalDolaras").ToString().ToDecimal() + End If + + End Get + Set(value As Decimal) + ViewState("ImporteOriginalDolaras") = value + End Set + End Property + + #Region "CANCELACIÓN COMPLEMENTO MODAL V2" Property CveComplementoPagoCancelar As Integer @@ -2471,6 +2498,9 @@ Partial Class Bancos_IE If CveOCSolicitudAnticipo > 0 Then + + + Dim ObjOC As New ClsOC If ObjOC.GetOCAnticipoSaldo(CveOCSolicitudAnticipo, UsuarioActual.CveEmpresa) Then SaldoOCAnticipo = ObjOC.DtResultados(0)("Saldo").ToString.ToDecimal @@ -2479,10 +2509,18 @@ Partial Class Bancos_IE End If ObjOC.Dispose() - If TxtImporte.Text.ToDecimal > SaldoOCAnticipo Then + Dim ImporteComparacion As Decimal = TxtImporte.Text.ToDecimal + + ' + If ChkPagarPesos.Checked Then + ImporteComparacion = ImporteOriginalDolaras + End If + + If ImporteComparacion > SaldoOCAnticipo Then EsValido = False Alert($"El importe del movimiento es mayor al saldo de la orden de compra importe movmiento {TxtImporte.Text.FormatoNumero } saldo orden de compra: {SaldoOCAnticipo.ToString.FormatoNumero}", TipoMensaje.MsgAdvertencia) End If + End If Return EsValido @@ -5557,11 +5595,23 @@ Partial Class Bancos_IE Else TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero) + + ImporteOriginalDolaras = DrOC("ImporteAnticipo").ToString.ToDecimal End If DdlMoneda.SelectedValue = DrOC("CveMoneda").ToString + CveMoneda = DrOC("CveMoneda").ToString.ToEntero CargaCuenta(DrOC("CveMoneda").ToString.ToEntero) + + CveMonedaOriginal = DrOC("CveMoneda").ToString.ToEntero + + + If CveMonedaOriginal > 1 Then + MostrarPagoEnPesos(True) + End If + + UpCuentaDeposito.Update() If DrOC("CveProveedor").ToString.ToEntero > 0 Then HdnCveProveedor.Value = DrOC("CveProveedor").ToString @@ -5644,6 +5694,69 @@ Partial Class Bancos_IE End If End Sub + + + Private Sub MostrarPagoEnPesos(Mostrar As Boolean) + + LbTipoMoneda.Visible = Mostrar + LbTipoMoneda.Text = If(Mostrar, "Pago en doalres", "") + DVPAgoEnPesos.Visible = Mostrar + ChkPagarPesos.Visible = Mostrar + + TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + + End Sub + + + Protected Sub ChkPagarPesos_CheckedChanged(sender As Object, e As EventArgs) + + If ChkPagarPesos.Checked Then + DivTC.Visible = True + DivTC2.Visible = True + ' DivDolaresDolares.Visible = False + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(1) + 'TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") + 'TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) + TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporteDolares.Text = TxtImporte.Text + 'TxtImporte.Text = (TxtImporte.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + CveMoneda = 1 + Else + DivTC.Visible = False + DivTC2.Visible = False + CveMoneda = CveMonedaOriginal + 'DivDolaresDolares.Visible = True + 'CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) + CargaCuenta(CveMonedaOriginal) + 'TxtFechaDocumento.Attributes.Remove("onchange") + TxtImporte.Text = ImporteOriginalDolaras.ToString("###,###,###.00") + End If + + CambiaTCPagoOC() + + UpDatos.Update() + + ' RegistraScript("CambiaPesosDolares();") + End Sub + + + Public Sub CambiaTCPagoOC() + + If ChkPagarPesos.Checked Then + TxtImporte.Text = (TxtImporteDolares.Text.ToDecimal * (TxtTC.Text.ToDecimal)).ToString("###,###,###.00") + Else + TxtImporte.Text = TxtImporteDolares.Text + End If + + UpDatos.Update() + End Sub + + Protected Sub LnkActualizaTCOC_Click(sender As Object, e As EventArgs) + CambiaTCPagoOC() + End Sub + + Private Function GuardaSolicitudAnticipoOC(ByRef ObjOC As ClsOC) As String Dim ObjOI As New ClsOIEventos Dim CveEvento As Integer = 0 @@ -6724,4 +6837,5 @@ Partial Class Bancos_IE RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString Calendario.EndDate = DateTime.Now End Sub + End Class \ No newline at end of file diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 2babcb0ea..654746115 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1812,7 +1812,7 @@ Partial Class Bancos_PopIECompras Funcionalidad = 313 ConceptoContable = 248 ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then - Funcionalidad = 578 + Funcionalidad = 577 ConceptoContable = 285 End If 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 d3cd9ce9f..57ab71324 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/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 3f30f6b29..1ba70513e 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1066,7 +1066,7 @@ Partial Class Bancos_ProveedoresAbonar Funcionalidad = 313 ConceptoContable = 248 ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then - Funcionalidad = 578 + Funcionalidad = 577 ConceptoContable = 285 End If @@ -1221,13 +1221,13 @@ Partial Class Bancos_ProveedoresAbonar importeMX = ImporteMovimiento ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago) + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) importeMX = ImporteMovimiento * tipoCambioCompra ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago) - importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago) + importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra) End If ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero) importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero) diff --git a/Bancos/RepProgramarRecursos.aspx.vb b/Bancos/RepProgramarRecursos.aspx.vb index 9d3ad6219..7e53e652a 100644 --- a/Bancos/RepProgramarRecursos.aspx.vb +++ b/Bancos/RepProgramarRecursos.aspx.vb @@ -654,7 +654,7 @@ Partial Class Bancos_RepProgramarRecursos ObjUsuarios.Dispose() End Sub Private Sub EnviaCorreoNotificacion() - If UsuarioActual.CveEmpresa = 13 Then + If UsuarioActual.CveEmpresa.Contiene(13, 83) Then Dim strBody As New StringBuilder Try 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/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7a895576b..7c8ceedc8 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4618,7 +4618,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 152, 153, 154, 159, 160, 161, 162, 163) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 145, 152, 153, 154, 159, 160, 161, 162, 163) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -6078,7 +6078,7 @@ Partial Class Compras_Compras End If 'si aplica NC sobre mov de almacen, el impuesto lo toma de la Factura.para la consideracion de mcia en tránsito - If ChkNCInvNC.Checked And CveMoneda <> 1 AndAlso importeMovimiento > 0 Then + If ChkNCInvNC.Checked And CveMoneda > 1 AndAlso importeMovimiento > 0 Then Dim diferenciaTransito As Decimal = 0 For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows @@ -8626,7 +8626,7 @@ Partial Class Compras_Compras Dim IndicePrimero As Integer = 0 For Each dRow As DataRow In TmpDT.Rows - If Boolean.Parse(dRow("AplicaIEPS").ToString) Then + If Boolean.Parse(dRow("AplicaIEPS").ToString) And dRow("IEPSPS").ToString.ToDecimal > 0 Then IndicePrimero = IndiceContador Exit For End If @@ -10392,7 +10392,8 @@ Partial Class Compras_Compras (row1("CveTipoGasto").ToString.ToEntero <> row2("CveTipoGasto").ToString.ToEntero) Or (row1("Total").ToString.ToDouble <> row2("Total").ToString.ToDouble) Or (row1("NoDeducible").ToString <> row2("NoDeducible").ToString) Or - (row1("CveActivoFijo").ToString.ToEntero <> row2("CveActivoFijo").ToString.ToEntero) Or + (row1("CveActivoFijo").ToString.ToEntero <> row2("CveActivoFijo").ToString.ToEntero) Or + (row1("AFMedida").ToString.ToEntero <> row2("AFMedida").ToString.ToEntero) Or (row1("CvePS").ToString.ToEntero <> row2("CvePS").ToString.ToEntero) Then Return False End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 2bb063817..fdb758268 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -195,11 +195,84 @@ Partial Class PopUpVerFactura SeleccionaReporte(UrlParametros) End If End If - + If Request("onlyPrint") IsNot Nothing Then + If Request("onlyPrint").ToString() = "Pallet" Then + imprimirpallet2(Request("CvePallet").ToString.ToEntero()) + End If + If Request("onlyPrint").ToString() = "PalletCaja" Then + imprimirpallet(Request("CvePallet").ToString.ToEntero()) + End If + End If End If End Sub + Private Sub imprimirpallet2(cvePallet As Integer) + Dim Envase As String = "" + Dim Tamano As String = "" + Dim Cultivo As String = "" + Dim noPallet As String = "" + Dim Variedad As String = "" + + 'Envase = "1 1/9" + 'Tamano = "Small" + 'Cultivo = "Tomate" + 'noPallet = "000001" + 'Variedad = "Golden" + Using objnom As New ClsNominas + If objnom.PA_Agro_Embarque_PalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then + Dim row As DataRow = objnom.DtResultados.Rows(0) + Envase = row("Envase").ToString() + Tamano = row("Tamaño").ToString() + Cultivo = row("Cultivo").ToString() + noPallet = row("Codigo").ToString() + Variedad = row("CultivoVariedad").ToString() + + End If + + End Using + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Envase", Envase)) + params.Add(New ReportParameter("Tamano", Tamano)) + params.Add(New ReportParameter("Cultivo", Cultivo)) + params.Add(New ReportParameter("noPallet", noPallet)) + params.Add(New ReportParameter("Variedad", Variedad)) + Dim tablaReporte As New DataTable + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + ImprimirPDF("GPS/PalletEtiqueta2.rdlc", (New List(Of ReportDataSource)), params, "Equipo GPS") + End Sub + Private Sub imprimirpallet(cvePallet As Integer) + Dim Envase As String = "" + Dim Tamano As String = "" + Dim Cultivo As String = "" + Dim noPallet As String = "" + + 'Envase = "1 1/9" + 'Tamano = "Small" + 'Cultivo = "Tomate" + 'noPallet = "000001" + Using objnom As New ClsNominas + If objnom.PA_Agro_Embarque_PalletGet(cvePallet, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1) And objnom.DtResultados.Rows.Count > 0 Then + Dim row As DataRow = objnom.DtResultados.Rows(0) + Envase = row("Envase").ToString() + Tamano = row("Tamaño").ToString() + Cultivo = row("Cultivo").ToString() + noPallet = row("Codigo").ToString() + + End If + + End Using + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("Envase", Envase)) + params.Add(New ReportParameter("Tamano", Tamano)) + params.Add(New ReportParameter("Cultivo", Cultivo)) + params.Add(New ReportParameter("noPallet", noPallet)) + Dim tablaReporte As New DataTable + '"Empresas/Grales/Formatos/EquiposGPS.rdlc" + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + ImprimirPDF("GPS/PalletEtiqueta.rdlc", (New List(Of ReportDataSource)), params, "Equipo GPS") + End Sub #Region "U S U A R I O - T O K E N" Private Function ValidaUsuarioSistema(CveEmpresa As Integer, Optional CveUsuario As Integer = 100) As Usuario @@ -846,15 +919,17 @@ Partial Class PopUpVerFactura Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) - 'If Imagen.Exists Then - ' params.Add(New ReportParameter("LogoPath", logouri)) + 'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), ""))) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) - 'Else - ' params.Add(New ReportParameter("LogoPath", "")) - 'End If + Else + params.Add(New ReportParameter("LogoPath", "")) + End If params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) @@ -931,8 +1006,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 = "" @@ -940,6 +1015,7 @@ Partial Class PopUpVerFactura + Dim PlacaVM As String = "" Dim AnioModeloVM As String = "" 'TIMBRADO @@ -950,15 +1026,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 @@ -973,11 +1051,12 @@ 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))) - + Dim DtMercancias As New DataTable() DtMercancias.Columns.Add(New DataColumn("Cantidad", GetType(Decimal))) DtMercancias.Columns.Add(New DataColumn("UnidadMedida", GetType(String))) @@ -990,7 +1069,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 @@ -1024,6 +1103,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 @@ -1060,40 +1140,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 @@ -1105,47 +1187,48 @@ 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() - End If + Row("TipoUbicacion") = ValorXML(node, "TipoUbicacion", "") + Row("FechaHoraSalida") = ValorXML(node, "FechaHoraSalidaLlegada", "") + Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "") + Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "") - 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() - 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 + + DtUbicaciones.Rows.Add(Row) Next @@ -1166,15 +1249,25 @@ Partial Class PopUpVerFactura CBB.GenerarCBB(UsuarioActual.Empresa.RFC, ClienteRFC, Total, FolioFiscal, RutaCBB) End If - ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, SerieFolio) + + ImagenCBB = New System.IO.FileInfo(RutaCBB) + + If ImagenCBB.Exists Then + ImgCBB = String.Format("file://{0}", ImagenCBB.FullName) + Else + ImgCBB = "" + End If + End If If DtConceptos.Rows.Count > 0 Then Dim params As New List(Of ReportParameter) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - If Imagen.Exists Then - params.Add(New ReportParameter("LogoPath", logouri)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + If Imagen.Exists Then + Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName) + params.Add(New ReportParameter("LogoPath", LogoRuta)) Else params.Add(New ReportParameter("LogoPath", "")) End If @@ -1197,8 +1290,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)) @@ -1221,6 +1314,9 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("SubTotal", SubTotal.ToString())) params.Add(New ReportParameter("Descuentos", Descuentos.ToString())) params.Add(New ReportParameter("Total", Total.ToString())) + + + ' [@CertificadoContribuyente] '[@CadenaOriginal] @@ -1246,7 +1342,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 @@ -1256,7 +1352,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) @@ -1280,16 +1376,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 = IfNull(Parametros("CVETIMBRE"), "0").ToString.ToEntero If Archivo.Exists Then DescargarArchivoPDFTraslado(Archivo, Path) Else If Exten = "pdf" Then - GeneraPDFFactura(Parametros("CVEMOVIMIENTO").ToString.ToEntero) + Dim ObjTimbres As New Timbres(Parametros("TIPODOCTO").ToString, cvetimbre, UsuarioActual) + + GeneraPDFFactura(ObjTimbres.ObjFactura) Archivo = New System.IO.FileInfo(Path) If Archivo.Exists Then DescargarArchivoPDFTraslado(Archivo, Path) @@ -1302,7 +1401,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) @@ -1310,12 +1409,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/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index 501e2f58e..165b2899a 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -398,7 +398,7 @@ Ot. Ing. -   +   @@ -459,6 +459,21 @@ txt.value = ""; } + //let chequeSeleccionado = parseInt($('#C_DDlCheques option:selected').val()); + + //if (chequeSeleccionado > 0) { + + + // let TotalOtrosEgresos = 0.0; + // $('.CsTxtComision').each(function () { + // TotalOtrosEgresos = parseFloat($(this).val()); + // }); + + // alert("Excedente " + Excedente + " TotalOtrosEgresos " + TotalOtrosEgresos); + + //} + + Excedente = SumaValores(); if (Excedente > 0) { @@ -666,9 +681,28 @@ $get('TxtTotal').value = FormatoNumero(Suma + (ToDouble($get('TxtOtrosImportes').value * -1)), 2); } + + let chequeSeleccionado = parseInt($('#C_DDlCheques option:selected').val()); + let TotalOtrosEgresos = 0.0; + + if (chequeSeleccionado > 0) { + + + + $('.CsTxtComision').each(function () { + TotalOtrosEgresos = parseFloat($(this).val()); + }); + + //alert("Excedente " + Excedente + " TotalOtrosEgresos " + TotalOtrosEgresos); EEEEEEEEEEEEEEEEEEEEEEEEE + + Excedente = Excedente + TotalOtrosEgresos; + + } + + if (Excedente > 0) { txt.value = FormatoNumero(ToDouble(txt.value) - Excedente, 2); - alert("El Importe no debe de exceder a el saldo del cheque"); + alert("Excedente " + Excedente + " TotalOtrosEgresos " + TotalOtrosEgresos); } diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb index da89c665e..748d2bd4c 100644 --- a/Compras/ReembolsosComprobaciones.aspx.vb +++ b/Compras/ReembolsosComprobaciones.aspx.vb @@ -744,9 +744,7 @@ Partial Class Compras_ReembolsosComprobaciones End If - - - + Dim ComisionTmp As Decimal = gvr.FCTextBox("TxtComision").Text.ToDecimal 'Otros Ingresos If (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then @@ -764,8 +762,15 @@ Partial Class Compras_ReembolsosComprobaciones If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal) Else PorcentajePago = 1 If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119, 158)) Then + + + Dim ImporteMovtoTmp As Decimal = ImporteMovto + If ComisionTmp < 0 Then + ImporteMovtoTmp = ImporteMovto + ComisionTmp + End If + 'Si es caja chica metemos el concepto 30, si es funcionario metemos 29 - If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovto, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovto), ImporteMX:=ImporteMovto * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then + If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, ImporteMovtoTmp, Referencia, If(CveCajaChica > 0, 30, 29), ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(CveCajaChica > 0, IdCuentaBancaria, IdCtaPersonal), -1, CveIE:=CveIEPago, CveIEDevolucion:=If(CveCajaChica > 0, If(DDlCheques.SelectedValue.ToEntero = -1, CveIECajaChica, DDlCheques.SelectedValue.ToEntero), -1), CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteMovtoTmp), ImporteMX:=ImporteMovtoTmp * tipoCambio, CveCuenta:=CveCuentaPersonal, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, Contabilizable:=If(CveCajaChica > 0 Or CvePersonal > 0, Not UsaSimplificacionCajaChica, True)) Then MsgError = "Detalle" End If End If diff --git a/Compras/RepComprasAF.aspx b/Compras/RepComprasAF.aspx index b6ee8e1f9..875cfda95 100644 --- a/Compras/RepComprasAF.aspx +++ b/Compras/RepComprasAF.aspx @@ -81,7 +81,7 @@
Grupo:
- + @@ -92,6 +92,7 @@ +
@@ -147,12 +148,21 @@
+
Clasificación:
-
+
+ + +
Clasificación 2:
+
+ + + +
Producto Servicio:
@@ -164,10 +174,11 @@
-
+
- + diff --git a/Compras/RepComprasAF.aspx.vb b/Compras/RepComprasAF.aspx.vb index 2c5fc308c..f6dae6e0f 100644 --- a/Compras/RepComprasAF.aspx.vb +++ b/Compras/RepComprasAF.aspx.vb @@ -90,6 +90,22 @@ Partial Class Compras_RepComprasAF DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() + + Dim ObjClasificacion As New ClsClasificaciones + + If ObjClasificacion.GetClasificacion2ProductoServicio(UsuarioActual.CveEmpresa) Then + DdlClasificacion2.DataSource = ObjClasificacion.DtResultados + Else + DdlClasificacion2.DataSource = Nothing + End If + + + ObjClasificacion.Dispose() + DdlClasificacion2.DataBind() + + + + DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataBind() @@ -154,10 +170,12 @@ Partial Class Compras_RepComprasAF Else TCEspecifico = -1 End If + If ObjCompras.GetRepComprasAF(FechaI, FechaF, DdlProveedores.SelectedValue.ToEntero, DdlMonedas.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, DdlClasificacion.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlTipoActivoFijo.SelectedValue.ToEntero, DdlSubTipoActivoFijo.SelectedValue.ToEntero, - CvePS, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + CvePS, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero) Then + DTDatos = ObjCompras.DtResultados GvDatos.DataSource = ObjCompras.DtResultados Else @@ -187,12 +205,19 @@ Partial Class Compras_RepComprasAF If CvePS = "" Or CvePS = "0" Then CvePS = "-1" End If - Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={CvePS}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}" + + If e.Row.DBCampo("Orden") = "1" Then + Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={CvePS}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}" e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DataKey("GPO").ToString) Else e.Row.BackColor = Drawing.Color.LightGray + Dim Liga As String = $"/Compras/RepComprasAFDetalle.aspx?GPO=-1&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={ e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&CveProveedor={ e.Row.DBCampo("CveProveedor")}&CveActivoFijo={e.Row.DBCampo("CveActivoFijo")}&CveTipoActivoFijo={e.Row.DBCampo("CveTipoActivoFijo")}&CveSubTipoActivoFijo={e.Row.DBCampo("CveSubTipoActivoFijo")}&CveProyecto={ DdlProyecto.SelectedValue}&CveSubProyecto={DdlSubProyecto.SelectedValue}&CvePS={CvePS}&CveClasificacion={e.Row.DBCampo("CveClasificacion")}&CveMoneda={ e.Row.DBCampo("CveMoneda")}&FechaI={FechaI}&FechaF={FechaF}&PS={PS}&CveClasificacion2={e.Row.DBCampo("CveClasificacion2")}" + + e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DataKey("Moneda").ToString) + End If + End If End Sub @@ -285,6 +310,11 @@ Partial Class Compras_RepComprasAF If DdlClasificacion.SelectedIndex > 0 Then ListaFiltros.Add("Clasificación: " & DdlClasificacion.SelectedItem.Text) End If + + If DdlClasificacion2.SelectedIndex > 0 Then + ListaFiltros.Add("Clasificación: " & DdlClasificacion2.SelectedItem.Text) + End If + For Each s As String In ListaFiltros If Contador > 0 Then filtro = filtro & ", " & s diff --git a/Compras/RepComprasAFDetalle.aspx b/Compras/RepComprasAFDetalle.aspx index fc94f34da..23ec0098d 100644 --- a/Compras/RepComprasAFDetalle.aspx +++ b/Compras/RepComprasAFDetalle.aspx @@ -173,10 +173,7 @@ -
- - - +
@@ -190,6 +187,14 @@ + +
Clasificación 2:
+
+ + + +
+
Producto Servicio:
@@ -218,12 +223,23 @@ + + + + SubProyecto + + + + + + ActivoFijo - + <%----%> + @@ -245,6 +261,48 @@ + + + + Responsable + + + + + + + + + Horometro/Odometro + + + + + + + + + + Tipo Mantenimiento + + + + + + + + + Clasificación 2 + + + + + + + + + + Unidad de Medida diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index e8de3702b..fd65f6a70 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -106,6 +106,7 @@ Partial Class Compras_RepComprasAFDetalle DdlSubProyecto.SelectedValueExist(Request.QueryString("CveSubProyecto").ToString) DdlProveedores.SelectedValueExist(Request.QueryString("CveProveedor").ToString) DdlClasificacion.SelectedValueExist(Request.QueryString("CveClasificacion").ToString) + DdlClasificacion2.SelectedValueExist(Request.QueryString("CveClasificacion2").ToString) If Request.QueryString("CvePS").ToString.Length > 0 Then DdlPS.txtText.Value = Request.QueryString("PS").ToString @@ -162,7 +163,7 @@ Partial Class Compras_RepComprasAFDetalle End If If UsuarioActual.CveEmpresa = 72 Then - GvDatos.Columns(2).Visible = True + GvDatos.Columns(3).Visible = True End If End If @@ -185,6 +186,25 @@ Partial Class Compras_RepComprasAFDetalle DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() + 'DdlClasificacion2.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") + 'DdlClasificacion2.DataBind() + + Dim ObjClasificacion As New ClsClasificaciones + + If ObjClasificacion.GetClasificacion2ProductoServicio(UsuarioActual.CveEmpresa) Then + DdlClasificacion2.DataSource = ObjClasificacion.DtResultados + Else + DdlClasificacion2.DataSource = Nothing + End If + + + ObjClasificacion.Dispose() + DdlClasificacion2.DataBind() + DdlClasificacion2.Items.Insert(0, New ListItem("Totas", "-1")) + DdlClasificacion2.Items.Insert(1, New ListItem("Sin Clasificación", "-2")) + DdlClasificacion2.SelectedValueExist(-1) + + DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataBind() DdlActivoFijo.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -276,7 +296,7 @@ Partial Class Compras_RepComprasAFDetalle If ObjCompras.GetRepComprasAFDetalle(FechaI, FechaF, DdlProveedores.SelectedValue.ToEntero, DdlMonedas.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1, DdlProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, DdlClasificacion.SelectedValue.ToEntero, DdlActivoFijo.SelectedValue.ToEntero, DdlTipoActivoFijo.SelectedValue.ToEntero, DdlSubTipoActivoFijo.SelectedValue.ToEntero, - CvePS, Anio.ToEntero, Mes.ToEntero, AnioMes, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then + CvePS, Anio.ToEntero, Mes.ToEntero, AnioMes, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero) Then DTDatos = ObjCompras.DtResultados GvDatos.DataSource = ObjCompras.DtResultados @@ -312,6 +332,7 @@ Partial Class Compras_RepComprasAFDetalle e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DBCampo("SerieFolio").ToString) Else e.Row.BackColor = Drawing.Color.LightGray + e.Row.Font.Bold = True End If End If @@ -434,6 +455,11 @@ Partial Class Compras_RepComprasAFDetalle ListaFiltros.Add("Clasificación: " & DdlClasificacion.SelectedItem.Text) End If + + If DdlClasificacion2.SelectedIndex > 0 Then + ListaFiltros.Add("Clasificación 2: " & DdlClasificacion2.SelectedItem.Text) + End If + For Each s As String In ListaFiltros If Contador > 0 Then diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index aa0875392..9879cf3e2 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -893,7 +893,7 @@ Partial Class ContabilidadC_RegPrePolizaS 'validaciones - If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then + If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) AndAlso UsuarioActual.CveRol <> 1 Then Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) Exit Sub End If 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/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..c7a5d2ecc --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx @@ -0,0 +1,321 @@ +<%@ 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..d625bdfd9 --- /dev/null +++ b/Documentacion/TableroMaterialidad.aspx.cs @@ -0,0 +1,1186 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Xml; +using System.Xml.Linq; +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("$('#ModalDoctosxmlpdf').modal();"); + Upxmlpdf.Update(); + } + + protected void LnkCargarZip_Click(object sender, EventArgs e) + { + string xmlobject = null; + List litsarchivoxml = Anexoxmlpdf.getfiles().Archivos; + if (litsarchivoxml.Count > 0) + { + Archivo archivoxml = litsarchivoxml[0]; + if (archivoxml.Extension.ToLower() == "zip") + { + + string directorio = archivoxml.FileUrl.Substring(0, archivoxml.FileUrl.Length - 4); + System.IO.Directory.CreateDirectory(directorio); + ZipFile.ExtractToDirectory(archivoxml.FileUrl, directorio); + + System.Xml.Linq.XDocument xmlarchivos = new System.Xml.Linq.XDocument(); + XElement xfolder = new XElement("folder"); + foreach (var urfile in System.IO.Directory.GetFiles(directorio, "*", SearchOption.AllDirectories)) + { + XElement xfile = new XElement("archivo", urfile); + xfile.SetAttributeValue("EXT", Path.GetExtension(urfile).ToLower()); + if (Path.GetExtension(urfile).ToLower() == ".xml") + { + var xmlobj = ADSistemaLibrary3.SatXml.XmlSatCFDI.readXML(urfile); + + + xfile.SetAttributeValue("Receptor", xmlobj.receptor.Nombre); + xfile.SetAttributeValue("RfcReceptor", xmlobj.receptor.Rfc); + xfile.SetAttributeValue("RfcEmisor", xmlobj.emisor.Rfc); + xfile.SetAttributeValue("Emisor", xmlobj.emisor.Nombre); + xfile.SetAttributeValue("SubTotal", xmlobj.comprobante.SubTotal); + xfile.SetAttributeValue("Descuento", xmlobj.comprobante.Descuento); + xfile.SetAttributeValue("Total", xmlobj.comprobante.Total); + + + xfile.SetAttributeValue("FechaPago", xmlobj.complemento.nomina12.FechaPago); + xfile.SetAttributeValue("FechaInicio", xmlobj.complemento.nomina12.FechaInicio); + xfile.SetAttributeValue("FechaFin", xmlobj.complemento.nomina12.FechaFin); + xfile.SetAttributeValue("NumDiasPagados", xmlobj.complemento.nomina12.NumDiasPagados); + xfile.SetAttributeValue("TotalPercepciones", xmlobj.complemento.nomina12.TotalPercepciones); + xfile.SetAttributeValue("TotalDeducciones", xmlobj.complemento.nomina12.TotalDeducciones); + xfile.SetAttributeValue("CURP", xmlobj.complemento.nomina12.Receptor.CURP); + + + + } + + + xfolder.Add(xfile); + } + xmlarchivos.Add(xfolder); + xmlobject = xmlarchivos.ToString(); + } + + } + foreach (Archivo obj in litsarchivoxml) + { + System.IO.File.Delete(obj.FileUrl); + } + RegistraScript("$('#ModalDoctosxmlpdf').modal();"); + } + + + + + + + + + +} +public class archivoxmlpdf +{ + string rutaarchivo { get; set; } + string extension { get; set; } + + + string RfcReceptor { get; set; } + string RfcEmisor { get; set; } + string Emisor { get; set; } + string Receptor { get; set; } + decimal SubTotal { get; set; } + decimal Descuento { get; set; } + decimal Total { get; set; } + + + string FechaPago { get; set; } + string periodo { get { return string.Format("", FechaInicialPago, FechaFinalPago); } } + + string FechaInicialPago { get; set; } + string FechaFinalPago { get; set; } + string Curp { get; set; } + int NumDiasPagados { get; set; } + decimal TotalPercepciones { get; set; } + decimal TotalDeducciones { get; set; } + +} + + + +namespace ADSistemaLibrary3.SatXml +{ + public class XmlSatCFDI + { + public XmlSatCFDI() + { + comprobante = new CFDIComprobante(); + emisor = new CFDIEmisor(); + receptor = new CFDIReceptor(); + complemento = new CFDIComplemento(); + cFDIRelacionados = new List(); + conceptos = new List(); + Impuestos = new List(); + } + public CFDIComprobante comprobante; + public CFDIEmisor emisor; + public CFDIReceptor receptor; + public CFDIComplemento complemento; + public List cFDIRelacionados; + public List conceptos; + public List Impuestos; + public List GetConceptosforpdf() + { + List lcon = new List(); + if (conceptos != null) + { + int _orden = 0; + foreach (CFDIConcepto item in conceptos) + { + _orden += 1; + CFDIConcepto_I con = new CFDIConcepto_I + { + tipo = 1, + orden = _orden, + ClaveProdServ = item.ClaveProdServ, + NoIdentificacion = item.NoIdentificacion, + Cantidad = item.Cantidad, + ClaveUnidad = item.ClaveUnidad, + Unidad = item.Unidad, + ValorUnitario = item.ValorUnitario, + Importe = item.Importe, + Descuento = item.Descuento, + NumeroPedimento = item.NumeroPedimento, + CuentaPredial = item.CuentaPredial, + Descripcion = item.Descripcion + }; + int index = 0; + foreach (CFDIConceptoImpuesto Imp in item.Impuestos) + { + index++; + if (index > 1) + { + lcon.Add(con); + con = new CFDIConcepto_I + { + tipo = 2, + orden = _orden, + }; + + } + + con.Impuesto = Imp.ImpuestoTexto; + con.Impuesto_Tipo = Imp.Tipo; + con.Impuesto_Base = Imp.Base; + con.Impuesto_TipoFactor = Imp.TipoFactor; + con.Impuesto_TasaOCuota = Imp.TasaOCuota; + con.Impuesto_Importe = Imp.Importe; + } + lcon.Add(con); + } + } + + return lcon; + } + + public static XmlSatCFDI readXML(string fileUrl) + { + XmlSatCFDI xmlCFDI = new XmlSatCFDI(); + bool canread = true; + //keys + string keyComprobante = "Comprobante"; + string keyCfdiRelacionados = "CfdiRelacionados"; + string keyEmisor = "Emisor"; + string keyReceptor = "Receptor"; + string keyConceptos = "Conceptos"; + string keyImpuestos = "Impuestos"; + string keyComplemento = "Complemento"; + //endkeys + string[] PrimerNivel = new string[] { keyCfdiRelacionados, keyEmisor, keyReceptor, keyConceptos, keyImpuestos, keyComplemento }; + //(canread = xtr.Read()) para evitar ciclos infinitos, todos los .Read() los guardo en la variable Canread y en los while reviso primero esta variable + if (File.Exists(fileUrl)) + { + XmlReaderSettings settings = new XmlReaderSettings(); + settings.ConformanceLevel = ConformanceLevel.Fragment; + settings.IgnoreWhitespace = true; + settings.IgnoreComments = true; + using (XmlReader xtr = XmlReader.Create(fileUrl, settings)) + { + + while ((canread = xtr.Read()) && !(xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyComprobante)) + { + //if (xtr.NodeType != XmlNodeType.Element) { while (xtr.Read() && xtr.NodeType != XmlNodeType.Element) { } } + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyComprobante) + { + int Nivel = xtr.Depth; + bool cont = xtr.MoveToFirstAttribute(); + while (cont) + { + + switch (xtr.Name.ToUpper()) + { + case "XMLNS:CFDI": xmlCFDI.comprobante.xmlns_cfdi = xtr.Value; break; + case "XMLNS:XSI": xmlCFDI.comprobante.xmlns_xsi = xtr.Value; break; + case "XSI:SCHEMALOCATION": xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value; break; + case "VERSION": xmlCFDI.comprobante.Version = xtr.Value; break; + case "SERIE": xmlCFDI.comprobante.Serie = xtr.Value; break; + case "FOLIO": xmlCFDI.comprobante.Folio = xtr.Value; break; + case "FECHA": xmlCFDI.comprobante.Fecha = xtr.Value; break; + case "MONEDA": xmlCFDI.comprobante.Moneda = xtr.Value; break; + case "SUBTOTAL": decimal SubTotal = 0; decimal.TryParse(xtr.Value, out SubTotal); xmlCFDI.comprobante.SubTotal = SubTotal; break; + case "TOTAL": decimal Total = 0; decimal.TryParse(xtr.Value, out Total); xmlCFDI.comprobante.Total = Total; break; + case "DESCUENTO": decimal Descuento = 0; decimal.TryParse(xtr.Value, out Descuento); xmlCFDI.comprobante.Descuento = Descuento; break; + case "TIPOCAMBIO": decimal TipoCambio = 0; decimal.TryParse(xtr.Value, out TipoCambio); xmlCFDI.comprobante.TipoCambio = TipoCambio; break; + case "TIPODECOMPROBANTE": xmlCFDI.comprobante.TipoDeComprobante = xtr.Value; break; + case "FORMAPAGO": xmlCFDI.comprobante.FormaPago = xtr.Value; break; + case "FORMADEPAGO": xmlCFDI.comprobante.FormaPago = xtr.Value; break; + case "METODOPAGO": xmlCFDI.comprobante.MetodoPago = xtr.Value; break; + case "METODODEPAGO": xmlCFDI.comprobante.MetodoPago = xtr.Value; break; + case "CONDICIONESDEPAGO": xmlCFDI.comprobante.CondicionesDePago = xtr.Value; break; + case "LUGAREXPEDICION": xmlCFDI.comprobante.LugarExpedicion = xtr.Value; break; + case "CONFIRMACION": xmlCFDI.comprobante.Confirmacion = xtr.Value; break; + case "NOCERTIFICADO": xmlCFDI.comprobante.NoCertificado = xtr.Value; break; + case "SELLO": xmlCFDI.comprobante.Sello = xtr.Value; break; + case "CERTIFICADO": xmlCFDI.comprobante.Certificado = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + cont = xtr.MoveToFirstAttribute(); + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > Nivel) + { + if (PrimerNivel.Contains(xtr.Name.Replace("cfdi:", ""))) + { + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyCfdiRelacionados) + { + int cDepth = xtr.Depth; + + string TipoRelacion = null; + cont = xtr.MoveToFirstAttribute(); + while (cont) + { + switch (xtr.Name.ToUpper()) + { + case "TIPORELACION": TipoRelacion = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > cDepth) + { + if (xtr.Name.Replace("cfdi:", "") == "CfdiRelacionado") + { + CFDIRelacionado cfdir = new CFDIRelacionado(); + cfdir.TipoRelacion = TipoRelacion; + cfdir.UUID = xtr.GetAttribute("UUID"); + xmlCFDI.cFDIRelacionados.Add(cfdir); + } + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyEmisor) + { + + + int curentNivel = xtr.Depth; + cont = xtr.MoveToFirstAttribute(); + while (cont) + { + switch (xtr.Name.ToUpper()) + { + case "REGIMENFISCAL": xmlCFDI.emisor.RegimenFiscal = xtr.Value; break; + case "NOMBRE": xmlCFDI.emisor.Nombre = xtr.Value; break; + case "RFC": xmlCFDI.emisor.Rfc = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + while ((canread = xtr.Read()) && !(xtr.NodeType == XmlNodeType.Element && curentNivel >= xtr.Depth)) { }//continua hasta que no tenga nodos y (el nodo sea tipo elemnto y ete en el mismo nivel) + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyReceptor) + { + int curentNivel = xtr.Depth; + cont = xtr.MoveToFirstAttribute(); + while (cont) + { + switch (xtr.Name.ToUpper()) + { + case "RFC": xmlCFDI.receptor.Rfc = xtr.Value; break; + case "NOMBRE": xmlCFDI.receptor.Nombre = xtr.Value; break; + case "RESIDENCIAFISCAL": xmlCFDI.receptor.ResidenciaFiscal = xtr.Value; break; + case "NUMREGIDTRIB": xmlCFDI.receptor.NumRegIdTrib = xtr.Value; break; + case "USOCFDI": xmlCFDI.receptor.UsoCFDI = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + + while ((canread = xtr.Read()) && !(xtr.NodeType == XmlNodeType.Element && curentNivel >= xtr.Depth)) { }//continua hasta que no tenga nodos y (el nodo sea tipo elemnto y ete en el mismo nivel) + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyConceptos) + { + int cDepth = xtr.Depth; + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > cDepth) + { + if (xtr.Name.Replace("cfdi:", "") == "Concepto") + { + int cDepthb = xtr.Depth; + CFDIConcepto concepto = new CFDIConcepto(); + + cont = xtr.MoveToFirstAttribute(); + while (cont) + { + switch (xtr.Name.ToUpper()) + { + case "CLAVEPRODSERV": concepto.ClaveProdServ = xtr.Value; break; + case "NOIDENTIFICACION": concepto.NoIdentificacion = xtr.Value; break; + case "CANTIDAD": concepto.Cantidad = xtr.Value; break; + case "CLAVEUNIDAD": concepto.ClaveUnidad = xtr.Value; break; + case "UNIDAD": concepto.Unidad = xtr.Value; break; + case "VALORUNITARIO": decimal ValorUnitario = 0; decimal.TryParse(xtr.Value, out ValorUnitario); concepto.ValorUnitario = ValorUnitario; ; break; + case "IMPORTE": decimal Importe = 0; decimal.TryParse(xtr.Value, out Importe); concepto.Importe = Importe; ; break; + case "DESCUENTO": decimal DDescuento = 0; decimal.TryParse(xtr.Value, out DDescuento); concepto.Descuento = DDescuento; ; break; + case "DESCRIPCION": concepto.Descripcion = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + xtr.MoveToFirstAttribute(); + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > cDepthb) + { + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == "Impuestos") + { + int cDepthc = xtr.Depth; + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > cDepthc) + { + if (xtr.Name.Replace("cfdi:", "") == "Traslado" || xtr.Name.Replace("cfdi:", "") == "Retencion") + { + CFDIConceptoImpuesto impuesto = new CFDIConceptoImpuesto(); + impuesto.Impuesto = xtr.GetAttribute("Impuesto"); + impuesto.Tipo = xtr.LocalName; + decimal Base = 0; + decimal.TryParse(xtr.GetAttribute("Base"), out Base); + impuesto.Base = Base; + impuesto.TipoFactor = xtr.GetAttribute("TipoFactor"); + decimal tasaOCuota = 0; + decimal.TryParse(xtr.GetAttribute("TasaOCuota"), out tasaOCuota); + impuesto.TasaOCuota = impuesto.TipoFactor == "Tasa" ? (tasaOCuota * 100).ToString("N4") : xtr.GetAttribute("TasaOCuota"); + decimal ImImporte = 0; + decimal.TryParse(xtr.GetAttribute("Importe"), out ImImporte); + impuesto.Importe = ImImporte; + + concepto.Impuestos.Add(impuesto); + } + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + + } + } + else + { + bool rednew = true; + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == "InformacionAduanera") + { + concepto.NumeroPedimento = xtr.GetAttribute("NumeroPedimento"); + rednew = false; while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == "CuentaPredial") + { + concepto.CuentaPredial = xtr.GetAttribute("CuentaPredial"); + rednew = false; while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + if (rednew) { while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } } + + } + } + + xmlCFDI.conceptos.Add(concepto); + } + } + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyImpuestos) + { + int cDepth = xtr.Depth; + + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > cDepth) + { + CFDIImpuesto impuest = new CFDIImpuesto(); + if (xtr.Name.Replace("cfdi:", "") == "Traslado" || xtr.Name.Replace("cfdi:", "") == "Retencion" && xmlCFDI.comprobante.Version != null) + { + impuest.Tipo = xtr.LocalName == "Traslado" ? "Traslados" : (xtr.LocalName == "Retencion" ? "Retenciones" : ""); + impuest.Impuesto = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("Impuesto") : xtr.GetAttribute("impuesto"); + impuest.TipoFactor = xtr.GetAttribute("TipoFactor"); + impuest.TasaOCuota = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("TasaOCuota") : xtr.GetAttribute("tasa"); + decimal ImImporte = 0; + decimal.TryParse((xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("Importe") : xtr.GetAttribute("importe")), out ImImporte); + impuest.Importe = ImImporte; + xmlCFDI.Impuestos.Add(impuest); + } + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + + } + } + if (xtr.NodeType == XmlNodeType.Element && xtr.Name.Replace("cfdi:", "") == keyComplemento) + { + int cDepth = xtr.Depth; + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + { + + + + + } + + + while (canread && xtr.Depth > cDepth) + { + if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName == "TimbreFiscalDigital" && xmlCFDI.comprobante.Version != null) + { + xmlCFDI.complemento.xmlns_tfd = xtr.GetAttribute("xmlns:tfd"); + xmlCFDI.complemento.xsi_schemaLocation = xtr.GetAttribute("xsi:schemaLocation"); + xmlCFDI.complemento.Version = xtr.GetAttribute("Version"); + xmlCFDI.complemento.UUID = xtr.GetAttribute("UUID"); + xmlCFDI.complemento.FechaTimbrado = xtr.GetAttribute("FechaTimbrado"); + xmlCFDI.complemento.RfcProvCertif = xtr.GetAttribute("RfcProvCertif"); + xmlCFDI.complemento.SelloCFD = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("SelloCFD") : xtr.GetAttribute("selloCFD"); + xmlCFDI.complemento.NoCertificadoSAT = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("NoCertificadoSAT") : xtr.GetAttribute("noCertificadoSAT"); + xmlCFDI.complemento.SelloSAT = xmlCFDI.comprobante.Version == "3.3" ? xtr.GetAttribute("SelloSAT") : xtr.GetAttribute("selloSAT"); + + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + else if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName.ToUpper() == "NOMINA" && xmlCFDI.comprobante.Version != null) + { + xmlCFDI.complemento.nomina12 = new CFDINomina(); + //Version="1.2" TipoNomina="E" FechaPago="2021-12-08" + //="2021-12-08" ="2021-12-08" + //="1" ="5026.31" ="254.34" + cont = xtr.MoveToFirstAttribute(); + while (cont) + { + switch (xtr.Name.ToUpper()) + { + case "FECHAPAGO": xmlCFDI.complemento.nomina12.FechaPago = xtr.Value.ToDateTime(); break; + case "FECHAINICIALPAGO": xmlCFDI.complemento.nomina12.FechaInicio = xtr.Value; break; + case "FECHAFINALPAGO": xmlCFDI.complemento.nomina12.FechaFin = xtr.Value; break; + case "NUMDIASPAGADOS": xmlCFDI.complemento.nomina12.NumDiasPagados = xtr.Value.ToEntero(); break; + case "TIPONOMINA": xmlCFDI.complemento.nomina12.TipoNomina = xtr.Value; break; + case "Version": xmlCFDI.complemento.nomina12.Version = xtr.Value; break; + } + cont = xtr.MoveToNextAttribute(); + } + xtr.MoveToFirstAttribute(); + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + else if (xtr.NodeType == XmlNodeType.Element && xtr.LocalName == "Pagos" && xmlCFDI.comprobante.Version != null) + { + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + xmlCFDI.complemento.Pagos = new CFDIPago(); + int depthpagos = xtr.Depth; + bool conts = xtr.MoveToFirstAttribute(); + while (conts) + { + + decimal Base = 0; + switch (xtr.Name.ToUpper()) + { + case "FECHAPAGO": xmlCFDI.complemento.Pagos.FechaPago = xtr.Value; break; + case "FORMADEPAGOP": xmlCFDI.complemento.Pagos.FormaDePagoP = xtr.Value; break; + case "FORMADEPAGOPTEXT": xmlCFDI.complemento.Pagos.FormaDePagoPText = xtr.Value; break; + case "MONEDAP": xmlCFDI.complemento.Pagos.MonedaP = xtr.Value; break; + case "MONTO": decimal.TryParse(xtr.Value, out Base); xmlCFDI.complemento.Pagos.Monto = Base; break; + case "TIPOCAMBIOP": decimal.TryParse(xtr.Value, out Base); xmlCFDI.complemento.Pagos.TipoCambioP = Base; break; + case "NUMOPERACION": xmlCFDI.complemento.Pagos.NumOperacion = xtr.Value; break; + case "NOMBANCOORDEXT": xmlCFDI.complemento.Pagos.NomBancoOrdExt = xtr.Value; break; + case "RFCEMISORCTAORD": xmlCFDI.complemento.Pagos.RfcEmisorCtaOrd = xtr.Value; break; + case "CTAORDENANTE": xmlCFDI.complemento.Pagos.CtaOrdenante = xtr.Value; break; + case "RFCEMISORCTABEN": xmlCFDI.complemento.Pagos.RfcEmisorCtaBen = xtr.Value; break; + case "CTABENEFICIARIO": xmlCFDI.complemento.Pagos.CtaBeneficiario = xtr.Value; break; + } + conts = xtr.MoveToNextAttribute(); + } + conts = xtr.MoveToFirstAttribute(); + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + while (canread && xtr.Depth > depthpagos) + { + CFDIPagoDoctoRelacionado objpago = new CFDIPagoDoctoRelacionado(); + conts = xtr.MoveToFirstAttribute(); + while (conts) + { + + decimal Basep = 0; + switch (xtr.Name.ToUpper()) + { + case "IDDOCUMENTO": objpago.IdDocumento = xtr.Value; break; + case "SERIE": objpago.Serie = xtr.Value; break; + case "FOLIO": objpago.Folio = xtr.Value; break; + case "MONEDADR": objpago.MonedaDR = xtr.Value; break; + case "METODODEPAGODR": objpago.MetodoDePagoDR = xtr.Value; break; + case "NUMPARCIALIDAD": objpago.NumParcialidad = xtr.Value; break; + case "IMPSALDOANT": decimal.TryParse(xtr.Value, out Basep); objpago.ImpSaldoAnt = Basep; break; + case "IMPPAGADO": decimal.TryParse(xtr.Value, out Basep); objpago.ImpPagado = Basep; break; + case "IMPSALDOINSOLUTO": decimal.TryParse(xtr.Value, out Basep); objpago.ImpSaldoInsoluto = Basep; break; + + } + conts = xtr.MoveToNextAttribute(); + } + conts = xtr.MoveToFirstAttribute(); + xmlCFDI.complemento.Pagos.doctosRelacionados.Add(objpago); + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + } + else + { + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + + } + } + } + } + else + { + //si no entro en ninguna de los anteriores no se debe ciclar + while ((canread = xtr.Read()) && xtr.NodeType != XmlNodeType.Element) { } + } + } + } + + } + } + if (xmlCFDI.comprobante.Version == "3.3" || xmlCFDI.comprobante.Version == "3.2") + { + return xmlCFDI; + } + else + { + return null; + } + } + + public class utilValores + { + public utilValores(string nombre, string valor) + { + Nombre = nombre; + Valor = valor; + } + public string Nombre { get; set; } + public string Valor { get; set; } + } + public class utilImage + { + public utilImage(byte[] imagenByte) + { + ImagenByte = imagenByte; + } + public byte[] ImagenByte { get; set; } + } + } + + public class CFDIComplemento + { + + public string xmlns_tfd { get; set; } + public string xsi_schemaLocation { get; set; } + public string Version { get; set; } + public string UUID { get; set; } + public string FechaTimbrado { get; set; } + public string RfcProvCertif { get; set; } + public string SelloCFD { get; set; } + public string NoCertificadoSAT { get; set; } + public string SelloSAT { get; set; } + public CFDIPago Pagos { get; set; } + public CFDINomina nomina12 { get; set; } + public string CadenaOriginal + { + get + { + return string.Format("||{0}|{1}|{2}|{3}|{4}|{5}||", Version, UUID, FechaTimbrado, RfcProvCertif, SelloCFD, NoCertificadoSAT); + } + } + + } + public class CFDIComprobante + { + public string xmlns_cfdi { get; set; } + public string xmlns_xsi { get; set; } + public string xsi_schemaLocation { get; set; } + public string Version { get; set; } + public string Serie { get; set; } + public string Folio { get; set; } + public string Fecha { get; set; } + public string Moneda { get; set; } + public decimal SubTotal { get; set; } + public decimal Total { get; set; } + public decimal Descuento { get; set; } + public decimal TipoCambio { get; set; } + public string TipoDeComprobante { get; set; } + + public string TipoDeComprobanteSIG + { + get + { + string retorno = ""; + if (Version == "3.3") + { + switch (TipoDeComprobante) + { + case "I": + retorno = "Ing"; + break; + case "E": + retorno = "Egs"; + break; + case "P": + retorno = "PA"; + break; + //case "T": + // retorno = "Traslado"; + // break; + //case "N": + // retorno = "Nómina"; + // break; + + default: + break; + } + } + else if (Version == "3.2") + { + switch (TipoDeComprobante) + { + case "ingreso": + retorno = "Ing"; + break; + case "egreso": + retorno = "Egs"; + break; + case "P": + retorno = "PA"; + break; + //case "T": + // retorno = "Traslado"; + // break; + //case "N": + // retorno = "Nómina"; + // break; + + default: + break; + } + } + else { retorno = TipoDeComprobante; } + return retorno; + } + } + public string TipoDeComprobanteTexto + { + get + { + string retorno = ""; + + if (Version == "3.3") + { + switch (TipoDeComprobante) + { + case "I": + retorno = "Ingreso"; + break; + case "E": + retorno = "Egreso"; + break; + case "P": + retorno = "Pago"; + break; + case "T": + retorno = "Traslado"; + break; + case "N": + retorno = "Nómina"; + break; + + default: + retorno = TipoDeComprobante; + break; + } + } + else if (Version == "3.2") + { + switch (TipoDeComprobante) + { + case "ingreso": + retorno = "Ing"; + break; + case "egreso": + retorno = "Egs"; + break; + case "P": + retorno = "PA"; + break; + //case "T": + // retorno = "Traslado"; + // break; + //case "N": + // retorno = "Nómina"; + // break; + + default: + retorno = TipoDeComprobante; + break; + } + } + else { retorno = TipoDeComprobante; } + return retorno; + } + } + public string FormaPago { get; set; } + + public string FormaPagoTexto + { + get + { + string retorno = ""; + + switch (FormaPago) + { + case "01": retorno = "Efectivo"; break; + case "02": retorno = "Cheque nominativo"; break; + case "03": retorno = "Transferencia electrónica de fondos"; break; + case "04": retorno = "Tarjeta de crédito"; break; + case "05": retorno = "Monedero electrónico"; break; + case "06": retorno = "Dinero electrónico"; break; + case "08": retorno = "Vales de despensa"; break; + case "12": retorno = "Dación en pago"; break; + case "13": retorno = "Pago por subrogación"; break; + case "14": retorno = "Pago por consignación"; break; + case "15": retorno = "Condonación"; break; + case "17": retorno = "Compensación"; break; + case "23": retorno = "Novación"; break; + case "24": retorno = "Confusión"; break; + case "25": retorno = "Remisión de deuda"; break; + case "26": retorno = "Prescripción o caducidad"; break; + case "27": retorno = "A satisfacción del acreedor"; break; + case "28": retorno = "Tarjeta de débito"; break; + case "29": retorno = "Tarjeta de servicios"; break; + case "30": retorno = "Aplicación de anticipos"; break; + case "31": retorno = "Intermediario pagos"; break; + case "99": retorno = "Por definir"; break; + default: retorno = FormaPago; break; + } + return retorno; + } + } + public string MetodoPago { get; set; } + public string MetodoPagoTexto + { + get + { + string retorno = ""; + + switch (MetodoPago) + { + case "PUE": retorno = "Pago en una sola exhibición"; break; + case "PPD": retorno = "Pago en parcialidades o diferido"; break; + default: retorno = MetodoPago; break; + } + return retorno; + } + } + public string CondicionesDePago { get; set; } + public string LugarExpedicion { get; set; } + public string Confirmacion { get; set; } + public string NoCertificado { get; set; } + public string Sello { get; set; } + public string Certificado { get; set; } + + } + + public class CFDIConcepto + { + public CFDIConcepto() + { + Impuestos = new List(); + } + public string ClaveProdServ { get; set; } + public string NoIdentificacion { get; set; } + public string Cantidad { get; set; } + public string ClaveUnidad { get; set; } + public string Unidad { get; set; } + public decimal ValorUnitario { get; set; } + public decimal Importe { get; set; } + public decimal Descuento { get; set; } + public string NumeroPedimento { get; set; } + public string CuentaPredial { get; set; } + public string Descripcion { get; set; } + public List Impuestos { get; set; } + } + + public class CFDIConcepto_I + { + public int tipo { get; set; } + public int orden { get; set; } + public string ClaveProdServ { get; set; } + public string NoIdentificacion { get; set; } + public string Cantidad { get; set; } + public string ClaveUnidad { get; set; } + public string Unidad { get; set; } + public decimal ValorUnitario { get; set; } + public decimal Importe { get; set; } + public decimal Descuento { get; set; } + public string NumeroPedimento { get; set; } + public string CuentaPredial { get; set; } + public string Descripcion { get; set; } + + + public string Impuesto { get; set; } + + public string Impuesto_Tipo { get; set; } + public decimal Impuesto_Base { get; set; } + public string Impuesto_TipoFactor { get; set; } + public string Impuesto_TasaOCuota { get; set; } + public decimal Impuesto_Importe { get; set; } + } + + public class CFDIConceptoImpuesto + { + public string Impuesto { get; set; } + public string ImpuestoTexto + { + get + { + string retorno = ""; + + switch (Impuesto) + { + case "001": retorno = "ISR"; break; + case "002": retorno = "IVA"; break; + case "003": retorno = "IEPS"; break; + } + return retorno; + } + } + public string Tipo { get; set; } + public decimal Base { get; set; } + public string TipoFactor { get; set; } + public string TasaOCuota { get; set; } + public decimal Importe { get; set; } + + } + + public class CFDIEmisor + { + public string RegimenFiscal { get; set; } + + public string RegimenFiscalTexto + { + get + { + string retorno = ""; + + switch (RegimenFiscal) + { + case "601": retorno = "General de Ley Personas Morales"; break; + case "603": retorno = "Personas Morales con Fines no Lucrativos"; break; + case "605": retorno = "Sueldos y Salarios e Ingresos Asimilados a Salarios"; break; + case "606": retorno = "Arrendamiento"; break; + case "608": retorno = "Demás ingresos"; break; + case "609": retorno = "Consolidación"; break; + case "610": retorno = "Residentes en el Extranjero sin Establecimiento Permanente en México"; break; + case "611": retorno = "Ingresos por Dividendos (socios y accionistas)"; break; + case "612": retorno = "Personas Físicas con Actividades Empresariales y Profesionales"; break; + case "614": retorno = "Ingresos por intereses"; break; + case "616": retorno = "Sin obligaciones fiscales"; break; + case "620": retorno = "Sociedades Cooperativas de Producción que optan por diferir sus ingresos"; break; + case "621": retorno = "Incorporación Fiscal"; break; + case "622": retorno = "Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras"; break; + case "623": retorno = "Opcional para Grupos de Sociedades"; break; + case "624": retorno = "Coordinados"; break; + case "628": retorno = "Hidrocarburos"; break; + case "607": retorno = "Régimen de Enajenación o Adquisición de Bienes"; break; + case "629": retorno = "De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales"; break; + case "630": retorno = "Enajenación de acciones en bolsa de valores"; break; + case "615": retorno = "Régimen de los ingresos por obtención de premios"; break; + + } + return retorno; + } + } + public string Nombre { get; set; } + public string Rfc { get; set; } + + } + + public class CFDIImpuesto + { + public string Tipo { get; set; } + public string Impuesto { get; set; } + public string ImpuestoTexto + { + get + { + string retorno = ""; + + switch (Impuesto) + { + case "001": retorno = "ISR"; break; + case "002": retorno = "IVA"; break; + case "003": retorno = "IEPS"; break; + } + return retorno; + } + } + public string TipoFactor { get; set; } + public string TasaOCuota { get; set; } + public decimal Importe { get; set; } + } + + public class CFDIPago + { + public CFDIPago() + { + doctosRelacionados = new List(); + } + public string FechaPago { get; set; } + public string FormaDePagoP { get; set; } + public string FormaDePagoPText { get; set; } + public string MonedaP { get; set; } + public decimal Monto { get; set; } + public decimal TipoCambioP { get; set; } + public string NumOperacion { get; set; } + public string NomBancoOrdExt { get; set; } + public string RfcEmisorCtaOrd { get; set; } + public string CtaOrdenante { get; set; } + public string RfcEmisorCtaBen { get; set; } + public string CtaBeneficiario { get; set; } + public List doctosRelacionados { get; set; } + } + + public class CFDIPagoDoctoRelacionado + { + public string IdDocumento { get; set; } + public string Serie { get; set; } + public string Folio { get; set; } + public string MonedaDR { get; set; } + public string MetodoDePagoDR { get; set; } + public string NumParcialidad { get; set; } + public decimal ImpSaldoAnt { get; set; } + public decimal ImpPagado { get; set; } + public decimal ImpSaldoInsoluto { get; set; } + } + + public class CFDIReceptor + { + public string Rfc { get; set; } + public string Nombre { get; set; } + public string ResidenciaFiscal { get; set; } + public string NumRegIdTrib { get; set; } + public string UsoCFDI { get; set; } + public string UsoCFDITexto + { + get + { + string retorno = "N/A"; + + switch (UsoCFDI) + { + case "G01": + retorno = "Adquisición de mercancías"; + break; + case "G02": + retorno = "Devoluciones, descuentos o bonificaciones"; + break; + case "G03": + retorno = "Gastos en general"; + break; + case "I01": + retorno = "Construcciones"; + break; + case "I02": + retorno = "Mobiliario y equipo de oficina por inversiones"; + break; + case "I03": + retorno = "Equipo de transporte"; + break; + case "I04": + retorno = "Equipo de cómputo y accesorios"; + break; + case "I05": + retorno = "Dados, troqueles, moldes, matrices y herramental"; + break; + case "I06": + retorno = "Comunicaciones telefónicas"; + break; + case "I07": + retorno = "Comunicaciones satelitales"; + break; + case "I08": + retorno = "Otra maquinaria y equipo"; + break; + case "D01": + retorno = "Honorarios médicos, dentales y gastos hospitalarios."; + break; + case "D02": + retorno = "Gastos médicos por incapacidad o discapacidad"; + break; + case "D03": + retorno = "Gastos funerales."; + break; + case "D04": + retorno = "Donativos."; + break; + case "D05": + retorno = "Intereses reales efectivamente pagados por créditos hipotecarios (casa habitación)."; + break; + case "D06": + retorno = "Aportaciones voluntarias al SAR."; + break; + case "D07": + retorno = "Primas por seguros de gastos médicos."; + break; + case "D08": + retorno = "Gastos de transportación escolar obligatoria."; + break; + case "D09": + retorno = "Depósitos en cuentas para el ahorro, primas que tengan como base planes de pensiones."; + break; + case "D10": + retorno = "Pagos por servicios educativos (colegiaturas)"; + break; + case "P01": + retorno = "Por definir"; + break; + + default: + break; + } + return retorno; + } + } + + } + + public class CFDIRelacionado + { + public string TipoRelacion { get; set; } + public string TipoRelacionTexto + { + + get + { + string retorno; + + switch (TipoRelacion) + { + case "01": retorno = "Nota de crédito de los documentos relacionados"; break; + case "02": retorno = "Nota de débito de los documentos relacionados"; break; + case "03": retorno = "Devolución de mercancía sobre facturas o traslados previos"; break; + case "04": retorno = "Sustitución de los CFDI previos"; break; + case "05": retorno = "Traslados de mercancias facturados previamente"; break; + case "06": retorno = "Factura generada por los traslados previos"; break; + case "07": retorno = "CFDI por aplicación de anticipo"; break; + default: + retorno = "Por definir"; + break; + } + return retorno; + } + } + public string UUID { get; set; } + + } +} + + + + 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/Empresas/132/Formatos/Factura.rdlc b/Empresas/132/Formatos/Factura.rdlc index 319a612b8..f56a59d45 100644 --- a/Empresas/132/Formatos/Factura.rdlc +++ b/Empresas/132/Formatos/Factura.rdlc @@ -1749,12 +1749,6 @@ 8pt - - =Today - - + + true + true + + + + + =Today + + + + + + + Textbox8 + 3.29402cm + 2.95339cm + 0.46771cm + 1.91468cm + 38 + + + 2pt + 2pt + 2pt + 2pt + + true 17.96022cm diff --git a/Empresas/Grales/Formatos/CartaPorte.rdlc b/Empresas/Grales/Formatos/CartaPorte.rdlc index 5870d72ed..c05f3e8c2 100644 --- a/Empresas/Grales/Formatos/CartaPorte.rdlc +++ b/Empresas/Grales/Formatos/CartaPorte.rdlc @@ -1602,8 +1602,8 @@ - Database - =System.Convert.FromBase64String(Parameters!LogoPath.Value ) + External + =Parameters!LogoPath.Value image/png FitProportional 0.46171in diff --git a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc index c64ce9ebd..54b24800a 100644 --- a/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc +++ b/Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc @@ -584,22 +584,73 @@ - 3.00921cm + 2.03633cm - 4.47377cm + 2.54796cm - 2.95726cm + 4.20919cm - 6.97146cm + 2.24876cm + + + 6.34152cm 0.6cm + + + + true + true + + + + + =Fields!TipoUbicacion.Value + + + + + + + TipoUbicacion + + 2pt + + + + + + 1pt + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -779,6 +830,46 @@ + + + 0.52062cm + + + true + true + + + + + Tipo Ubicación + + + + + + + Textbox28 + + + #4f81bd + 2pt + 2pt + 2pt + 2pt + + + + + 0.52062cm @@ -1004,7 +1095,7 @@ 8.2018cm 0.42363cm 1.12062cm - 19.10097cm + 19.07303cm 3 @@ -100,7 +120,7 @@ 0.84237cm 0.09525cm 0cm - 25.79479cm + 26.76762cm 1 + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + @@ -178,7 +244,10 @@ Descripcion - + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Horometro/ + + + + + + + + + LightGrey + 2pt + 2pt + 2pt + 2pt + + + + @@ -239,8 +391,11 @@ - Unidad M. - + + + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + @@ -400,7 +597,7 @@ - =Fields!Descripcion.Value + =Fields!CodigoAF.Value @@ -456,6 +653,72 @@ + + + + true + true + + + + + =Fields!NombreCompleto.Value + + + + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!AFMedida.Value + + + + + + =IIF(Fields!Orden.Value.ToString = "0","Silver","White") + 2pt + 2pt + 2pt + 2pt + + + + @@ -610,6 +873,9 @@ + + + @@ -626,7 +892,7 @@ 0.9482cm 0.09525cm 1.06771cm - 25.79479cm + 26.76762cm 2 @@ -722,7 +988,7 @@ 1.10271cm 0.09525cm 0.52945cm - 25.79479cm + 26.76762cm 1 + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logojam + FitProportional + 4.18451cm + 1.20854cm + 1.82222cm + 1 + + + + + + true + true + + + + + CARR. A BAHIA DE KINO +KM12 HERMOSILLO, SONORA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SFD-101-00001 + + + + + + + 1.80826cm + 0.03529cm + 0.59999cm + 5.97145cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Trace this product at sig.adssistemas.mx + + + + + + + 2.51409cm + 0.0353cm + 0.38833cm + 5.97143cm + 4 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + + 3.04353cm + 3.0305cm + 0.4677cm + 2.97624cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode + FitProportional + 4.16387cm + 0.51424cm + 1.42062cm + 5.01354cm + 7 + + + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + + 3.59034cm + 3.0305cm + 0.4677cm + 2.97624cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Produce of MX. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 54 + + + + + + + + 62 + + + + + + + 5.76088cm + 3.71571cm + 1.11179cm + 1.81207cm + 11 + + + Black + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + 0.36724cm + 7.13021cm + 6.00674cm + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logojam + FitProportional + 4.18451cm + 1.20854cm + 1.82222cm + 1 + + + + + + true + true + + + + + CARR. A BAHIA DE KINO +KM12 HERMOSILLO, SONORA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SFD-101-00001 + + + + + + + 1.80826cm + 0.03529cm + 0.59999cm + 5.97145cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Trace this product at sig.adssistemas.mx + + + + + + + 2.51409cm + 0.0353cm + 0.38833cm + 5.97143cm + 4 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + + 3.04353cm + 3.0305cm + 0.4677cm + 2.97624cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode + FitProportional + 4.16387cm + 0.51424cm + 1.42062cm + 5.01354cm + 7 + + + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + + 3.59034cm + 3.0305cm + 0.4677cm + 2.97624cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Produce of MX. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 54 + + + + + + + + 62 + + + + + + + 5.76088cm + 3.71571cm + 1.11179cm + 1.81207cm + 11 + + + Black + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + 0.36724cm + 6.18313cm + 7.13021cm + 6.00674cm + 1 + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logojam + FitProportional + 4.18451cm + 1.20854cm + 1.82222cm + 1 + + + + + + true + true + + + + + CARR. A BAHIA DE KINO +KM12 HERMOSILLO, SONORA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SFD-101-00001 + + + + + + + 1.80826cm + 0.03529cm + 0.59999cm + 5.97145cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Trace this product at sig.adssistemas.mx + + + + + + + 2.51409cm + 0.0353cm + 0.38833cm + 5.97143cm + 4 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + + 3.04353cm + 3.0305cm + 0.4677cm + 2.97624cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode + FitProportional + 4.16387cm + 0.51424cm + 1.42062cm + 5.01354cm + 7 + + + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + + 3.59034cm + 3.0305cm + 0.4677cm + 2.97624cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Produce of MX. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 54 + + + + + + + + 62 + + + + + + + 5.76088cm + 3.71571cm + 1.11179cm + 1.81207cm + 11 + + + Black + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + 7.5274cm + 0.13668cm + 7.13021cm + 6.00674cm + 2 + + + + + + + + true + true + + + + + AGROPECUARIA JAM, S.A. DE C.V. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + logojam + FitProportional + 4.18451cm + 1.20854cm + 1.82222cm + 1 + + + + + + true + true + + + + + CARR. A BAHIA DE KINO +KM12 HERMOSILLO, SONORA + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SFD-101-00001 + + + + + + + 1.80826cm + 0.03529cm + 0.59999cm + 5.97145cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Trace this product at sig.adssistemas.mx + + + + + + + 2.51409cm + 0.0353cm + 0.38833cm + 5.97143cm + 4 + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + + 3.04353cm + 3.0305cm + 0.4677cm + 2.97624cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode + FitProportional + 4.16387cm + 0.51424cm + 1.42062cm + 5.01354cm + 7 + + + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + + 3.59034cm + 3.0305cm + 0.4677cm + 2.97624cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Produce of MX. + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 54 + + + + + + + + 62 + + + + + + + 5.76088cm + 3.71571cm + 1.11179cm + 1.81207cm + 11 + + + Black + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + 7.5274cm + 6.31981cm + 7.13021cm + 6.00674cm + 3 + + + + + + 6.24016in + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 03 + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMMODITY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Variedad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VARIETY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + STYLE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SIZE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Grower + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + LABEL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!NoCajas.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + PACKS + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode1 + FitProportional + 3.46683cm + 1.51697cm + 1.5cm + 3.24489cm + 14 + + + + + + + + true + true + + + + + PALLET-TAG + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 03 + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMMODITY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VARIETY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COUNTRY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Variedad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + MEXICO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + STYLE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SIZE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + LABEL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Grower + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode1 + FitProportional + 0.61954cm + 6.0624cm + 1.5cm + 3.24489cm + 14 + + + + + + true + 5.46072cm + 0.0353cm + 2.59618cm + 9.33165cm + 15 + + + + + + + + true + true + + + + + PALLET-TAG + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 03 + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMMODITY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VARIETY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COUNTRY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Variedad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + MEXICO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + STYLE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SIZE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + LABEL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Grower + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode1 + FitProportional + 0.61954cm + 6.0624cm + 1.5cm + 3.24489cm + 14 + + + + + + true + 8.19801cm + 0.05708cm + 2.59618cm + 9.33165cm + 16 + + + + + + + + true + true + + + + + PALLET-TAG + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 03 + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMMODITY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VARIETY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COUNTRY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Variedad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + MEXICO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + STYLE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SIZE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + LABEL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Grower + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode1 + FitProportional + 0.61954cm + 6.0624cm + 1.5cm + 3.24489cm + 14 + + + + + + true + 10.79419cm + 0.05708cm + 2.59618cm + 9.33165cm + 17 + + + + + + + + true + true + + + + + PALLET-TAG + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + 03 + + + + =Parameters!noPallet.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COMMODITY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + VARIETY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + COUNTRY + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Cultivo.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Variedad.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + MEXICO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + STYLE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + SIZE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + LABEL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Envase.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!Tamano.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Grower + + + + + + 2pt + 2pt + 2pt + 2pt + + + + Embedded + barcode1 + FitProportional + 0.61954cm + 6.0624cm + 1.5cm + 3.24489cm + 14 + + + + + + true + 13.34436cm + 0.05708cm + 2.59618cm + 9.33165cm + 18 + + + + + + true + 0.14291cm + 0.09907cm + 15.94054cm + 9.49453cm + + + + + + 6.97802in + - Entrega Almacen Ruta + Ruta de Entrega/Recolección @@ -23,14 +30,14 @@
  • - -
  • + +
    - +
    - + @@ -39,124 +46,58 @@
    -
    - +
    +
    -
    +
    + +
    - +
    -
    -
    - - - - +
    +
    + + + + +
    + + + + + +
    - - - - - - -
    - -
    -
    - - - - + +
    +
    + + + + +
    + + + + + +
    - - - - - - -
    + + - - - - - -
    - -
    - Chofer: -
    -
    - - - -
    -
    - Unidad: -
    -
    - - - -
    - -
    - Fecha de Entrega: -
    - -
    -
    - - - - - - - - -
    -
    -
    - Carta Porte: -
    -
    - - -
    -
    - -
    - -
    - Preselección de Entregas -
    - -
    - -
    - -
    - -
    - - - -
    - - - - @@ -172,14 +113,64 @@
    +
    + +
    + + + + + + +
    + +
    + + + + + +
    + +
    +
    + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    + Preseleccionar + +
    -
    +
    + +
    + +
    + +
    - -   @@ -214,19 +204,18 @@   - + + +   + + + - - -
    -
    - -
    @@ -250,7 +239,7 @@ <%----%> - + @@ -282,112 +271,201 @@ - - -
    - - - -
    - - - + + + - - + - -
    -
    - - - - - <%----%> - - -   - - - - -   - - - - -   - - - - - - - - - - - - - - - - - - +
    + +
    + + + + + +
    + +
    + + + + + +
    + +
    +
    + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    + Recoleccion + + +
    -
    +
    +
    - + + + + +   + + + <%----%> + + +   + + + + +   + + + + +   + + + + +   + + + + + + + + + + + + + + + + +
    + +
    +
    +
    - - + + + + + +   + + + + + + <%----%> + + + + + + + + + + + +   + + + + <%----%> + + +   + + + + +   + + + + +   + + + + + + + + +
    + +
    + - + - - - - - - - - - - - - - + +