diff --git a/Acarreos/CatChoferes.aspx b/Acarreos/CatChoferes.aspx index 3cd1b9183..4187821b9 100644 --- a/Acarreos/CatChoferes.aspx +++ b/Acarreos/CatChoferes.aspx @@ -28,7 +28,7 @@ " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + DataKeyNames="CveChofer,Chofer,Estatus,FechaIng,CveUsuario,CveEmpresa,Usuario,CveTransportista,Identificacion,Domicilio,Telefono,Ciudad,RFC,Licencia,NumeroInterior,NumeroExterior,Colonia,Estado,NumRegidTribOperador,ResidenciaFiscalOperador,CP" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Choferes"> diff --git a/Acarreos/CatChoferes.aspx.vb b/Acarreos/CatChoferes.aspx.vb index 2807faa3d..cf58bbabe 100644 --- a/Acarreos/CatChoferes.aspx.vb +++ b/Acarreos/CatChoferes.aspx.vb @@ -74,6 +74,7 @@ Partial Class Acarreos_CatChoferes TxtChofer.Text = GvRow.DataKey("Chofer") TxtIdentificacion.Text = GvRow.DataKey("Identificacion") TxtTelefono.Text = GvRow.DataKey("Telefono") + TxtRFC.Text = GvRow.DataKey("RFC") TxtDomicilio.Text = GvRow.DataKey("Domicilio") TxtNumInt.Text = GvRow.DataKey("NumeroInterior") diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index a5704429e..02f4141a0 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -578,7 +578,11 @@ Public Class CFDICartaPorte Public Property TranspInternac As String = "" Public Property EntradaSalidaMercancia As String = "" Public Property ViaEntradaSalida As String = "" - Public Property TotalDistanciaRecorrida As Double = 0 + Public ReadOnly Property TotalDistanciaRecorrida As Decimal + Get + Return Ubicaciones.Sum(Function(item) item.DistanciaRecorrida) * 2 + End Get + End Property Public Property Ubicaciones As New List(Of CFDICartaPorteUbicaciones) Public Property Mercancias As New CFDICartaPorteMercancias Public Property FiguraTransporte As New CFDICartaPorteFiguraTransporte diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index a84761df1..9f6c539d7 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3310,9 +3310,9 @@ Public Class ClsGenerales Return Retorno End Function - Public Function GetCartaPorteTipoPermiso() As Boolean + Public Function GetCartaPorteTipoPermisoSCT() As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Gral_CP_TipoPermisoGet") + DataAdapter("PA_Gral_CP_TipoPermisoSCTGet") Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 31a54c57f..28c446361 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2736,6 +2736,8 @@ Namespace Modelos Dim CveVenta As Integer = ObjFactura.CveVenta Dim CveVentaAmortizacion As Integer = row2("CveVenta").ToString().ToEntero + If row2("CveIE").ToString().ToEntero > 0 Then CveIEAnticipo = row2("CveIE").ToString().ToEntero + 'FALTA LA MONEDA PAR ALA CUENTA .RMF Y MANDAR EL CVEIE 'SI ES FACTURA EN 0 Y TIENE ANTICIPOS If (ObjFactura.Total = 0 AndAlso UsuarioActual.CveEmpresa.Contiene(72) AndAlso ObjFactura.TipoDocto.Contiene("Ing")) AndAlso row2("TipoDocto").ToString() = "Ant" Then @@ -2752,7 +2754,7 @@ Namespace Modelos If importeMovimiento <> 0 Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVenta, CveVentaAmortizacion:=CveVentaAmortizacion, CveCliente:=ObjFactura.CveCliente, - CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), + CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True Exit For @@ -6699,30 +6701,30 @@ Namespace Modelos If Not Me.disposedValue Then If disposing Then '' TODO: dispose managed state (managed objects). - If Not DtDetalle Is Nothing Then DtDetalle.Dispose() - If Not DtAjustes Is Nothing Then DtAjustes.Dispose() - If Not DtAnticipos Is Nothing Then DtAnticipos.Dispose() - If Not DtContratosSerieDetalle Is Nothing Then DtContratosSerieDetalle.Dispose() - If Not DtCotizacionesPS Is Nothing Then DtCotizacionesPS.Dispose() - If Not DtDeduccion Is Nothing Then DtDeduccion.Dispose() - If Not DtDesgloseImpuestos Is Nothing Then DtDesgloseImpuestos.Dispose() - If Not DtDocumentacionCliente Is Nothing Then DtDocumentacionCliente.Dispose() - If Not DtDocumentosRelacionados Is Nothing Then DtDocumentosRelacionados.Dispose() - If Not DtFirmas Is Nothing Then DtFirmas.Dispose() - If Not DtImpuestosLocales Is Nothing Then DtImpuestosLocales.Dispose() - If Not DtInventario Is Nothing Then DtInventario.Dispose() - If Not DtNCVinculadas Is Nothing Then DtNCVinculadas.Dispose() - If Not DTOrdenesCompraPS Is Nothing Then DTOrdenesCompraPS.Dispose() - If Not DtOtrosConceptos Is Nothing Then DtOtrosConceptos.Dispose() - If Not DtPagos Is Nothing Then DtPagos.Dispose() - If Not DtPedidos2 Is Nothing Then DtPedidos2.Dispose() - If Not DtPedidos2PS Is Nothing Then DtPedidos2PS.Dispose() - If Not DtPromociones Is Nothing Then DtPromociones.Dispose() - If Not DtRecepcionUsados Is Nothing Then DtRecepcionUsados.Dispose() - If Not DtRemConceptosSurtidos Is Nothing Then DtRemConceptosSurtidos.Dispose() - If Not DtRemisiones Is Nothing Then DtRemisiones.Dispose() - If Not DtRemisionesPS Is Nothing Then DtRemisionesPS.Dispose() - If Not DtVentasNC Is Nothing Then DtVentasNC.Dispose() + If Not DtDetalle Is Nothing Then DtDetalle.Dispose() : DtDetalle = Nothing + If Not DtAjustes Is Nothing Then DtAjustes.Dispose() : DtAjustes = Nothing + If Not DtAnticipos Is Nothing Then DtAnticipos.Dispose() : DtAnticipos = Nothing + If Not DtContratosSerieDetalle Is Nothing Then DtContratosSerieDetalle.Dispose() : DtContratosSerieDetalle = Nothing + If Not DtCotizacionesPS Is Nothing Then DtCotizacionesPS.Dispose() : DtCotizacionesPS = Nothing + If Not DtDeduccion Is Nothing Then DtDeduccion.Dispose() : DtDeduccion = Nothing + If Not DtDesgloseImpuestos Is Nothing Then DtDesgloseImpuestos.Dispose() : DtDesgloseImpuestos = Nothing + If Not DtDocumentacionCliente Is Nothing Then DtDocumentacionCliente.Dispose() : DtDocumentacionCliente = Nothing + If Not DtDocumentosRelacionados Is Nothing Then DtDocumentosRelacionados.Dispose() : DtDocumentosRelacionados = Nothing + If Not DtFirmas Is Nothing Then DtFirmas.Dispose() : DtFirmas = Nothing + If Not DtImpuestosLocales Is Nothing Then DtImpuestosLocales.Dispose() : DtImpuestosLocales = Nothing + If Not DtInventario Is Nothing Then DtInventario.Dispose() : DtInventario = Nothing + If Not DtNCVinculadas Is Nothing Then DtNCVinculadas.Dispose() : DtNCVinculadas = Nothing + If Not DTOrdenesCompraPS Is Nothing Then DTOrdenesCompraPS.Dispose() : DTOrdenesCompraPS = Nothing + If Not DtOtrosConceptos Is Nothing Then DtOtrosConceptos.Dispose() : DtOtrosConceptos = Nothing + If Not DtPagos Is Nothing Then DtPagos.Dispose() : DtPagos = Nothing + If Not DtPedidos2 Is Nothing Then DtPedidos2.Dispose() : DtPedidos2 = Nothing + If Not DtPedidos2PS Is Nothing Then DtPedidos2PS.Dispose() : DtPedidos2PS = Nothing + If Not DtPromociones Is Nothing Then DtPromociones.Dispose() : DtPromociones = Nothing + If Not DtRecepcionUsados Is Nothing Then DtRecepcionUsados.Dispose() : DtRecepcionUsados = Nothing + If Not DtRemConceptosSurtidos Is Nothing Then DtRemConceptosSurtidos.Dispose() : DtRemConceptosSurtidos = Nothing + If Not DtRemisiones Is Nothing Then DtRemisiones.Dispose() : DtRemisiones = Nothing + If Not DtRemisionesPS Is Nothing Then DtRemisionesPS.Dispose() : DtRemisionesPS = Nothing + If Not DtVentasNC Is Nothing Then DtVentasNC.Dispose() : DtVentasNC = Nothing End If End If Me.disposedValue = True diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index eb7963a0e..f90e995a9 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -9,6 +9,7 @@ Imports System.Xml Imports System.Data Imports System.Xml.Serialization Imports System.Net +Imports ProfactCartaPorte = Profact.TimbraCFDI33.Complementos.CartaPorte10 Public Class Timbrado @@ -2129,8 +2130,8 @@ Public Class Timbrado #Region "C O M P L E M E N T O C A R T A P O R T E" + If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then - If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte @@ -2191,7 +2192,6 @@ Public Class Timbrado End If - End If #End Region @@ -3413,7 +3413,7 @@ Public Class Timbrado If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E") Then -#Region "Impuestos" +#Region " Impuestos" 'SI NO ES FACTURA EN 0 AGREGA LOS IMPUESTOS If Ventas.Total <> 0 OrElse (ObjCFDITimbre.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.TotalImpuestosTrasladados > 0) Then comprobante.Impuestos = New Profact.TimbraCFDI33.ComprobanteImpuestos() @@ -3453,7 +3453,7 @@ Public Class Timbrado #End Region -#Region "Impuestos Locales" +#Region " Impuestos Locales" If ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe) > 0 Then @@ -3487,7 +3487,7 @@ Public Class Timbrado #End Region -#Region "Comercio Exterior" +#Region " Comercio Exterior" If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then @@ -3653,15 +3653,9 @@ Public Class Timbrado #End Region - - - - - - End If -#Region "Complemento Pago" +#Region " Complemento Pago" If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then Dim ComPag = New Profact.TimbraCFDI33.Complementos.Pagos10.Pagos() @@ -3782,18 +3776,15 @@ Public Class Timbrado #End Region -#Region "C O M P L E M E N T O C A R T A P O R T E" +#Region " C O M P L E M E N T O C A R T A P O R T E" If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then - If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte - - - ''DATOS GENERALES - Dim ComCartaPorte = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorte() - Dim Transp As Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteTranspInternac + ''DATOS GENERALES + Dim ComCartaPorte = New ProfactCartaPorte.CartaPorte() + Dim Transp As ProfactCartaPorte.CartaPorteTranspInternac ComCartaPorte.TranspInternac = If(Carta.TranspInternac = "No", Transp.No, Transp.Sí) ComCartaPorte.EntradaSalidaMercSpecified = False ComCartaPorte.ViaEntradaSalidaSpecified = False @@ -3802,17 +3793,17 @@ Public Class Timbrado 'UBICACIONES If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then Dim i As Integer = 0 - ComCartaPorte.Ubicaciones = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacion(Carta.Ubicaciones.Count - 1) {} + ComCartaPorte.Ubicaciones = New ProfactCartaPorte.CartaPorteUbicacion(Carta.Ubicaciones.Count - 1) {} For Each ubica As CFDICartaPorteUbicaciones In Carta.Ubicaciones 'origen - ComCartaPorte.Ubicaciones(i) = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacion + ComCartaPorte.Ubicaciones(i) = New ProfactCartaPorte.CartaPorteUbicacion ComCartaPorte.Ubicaciones(i).TipoEstacionSpecified = False ComCartaPorte.Ubicaciones(i).DistanciaRecorrida = ubica.DistanciaRecorrida - ComCartaPorte.Ubicaciones(i).Origen = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionOrigen With {.IDOrigen = ubica.Origen.IDOrigen, + ComCartaPorte.Ubicaciones(i).Origen = New ProfactCartaPorte.CartaPorteUbicacionOrigen With {.IDOrigen = ubica.Origen.IDOrigen, .RFCRemitente = ubica.Origen.RFCRemitente, .NombreRemitente = ubica.Origen.NombreRemitente, .FechaHoraSalida = ubica.Origen.FechaHoraSalida.ToDate} - ComCartaPorte.Ubicaciones(i).Domicilio = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDomicilio With {.Calle = ubica.Origen.Domicilio.Calle, + ComCartaPorte.Ubicaciones(i).Domicilio = New ProfactCartaPorte.CartaPorteUbicacionDomicilio With {.Calle = ubica.Origen.Domicilio.Calle, .NumeroExterior = ubica.Origen.Domicilio.NumeroExterior, .NumeroInterior = ubica.Origen.Domicilio.NumeroInterior, .Colonia = ubica.Origen.Domicilio.Colonia, @@ -3825,12 +3816,12 @@ Public Class Timbrado - ComCartaPorte.Ubicaciones(i).Destino = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDestino With {.IDDestino = ubica.Destino.IDDestino, + ComCartaPorte.Ubicaciones(i).Destino = New ProfactCartaPorte.CartaPorteUbicacionDestino With {.IDDestino = ubica.Destino.IDDestino, .RFCDestinatario = ubica.Destino.RFCDestinatario, .NombreDestinatario = ubica.Destino.NombreDestinatario, .FechaHoraProgLlegada = ubica.Destino.FechaHoraProgLlegada.ToDate} - ComCartaPorte.Ubicaciones(i).Domicilio = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteUbicacionDomicilio With {.Calle = ubica.Destino.Domicilio.Calle, + ComCartaPorte.Ubicaciones(i).Domicilio = New ProfactCartaPorte.CartaPorteUbicacionDomicilio With {.Calle = ubica.Destino.Domicilio.Calle, .NumeroExterior = ubica.Destino.Domicilio.NumeroExterior, .NumeroInterior = ubica.Destino.Domicilio.NumeroInterior, .Colonia = ubica.Destino.Domicilio.Colonia, @@ -3852,89 +3843,132 @@ Public Class Timbrado End If - 'MERCANCIAS - If Carta.Mercancias IsNot Nothing Then - ComCartaPorte.Mercancias = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercancias - ComCartaPorte.Mercancias.PesoBrutoTotal = Carta.Mercancias.PesoBrutoTotal.ToDecimal - ComCartaPorte.Mercancias.PesoNetoTotal = Carta.Mercancias.PesoNetoTotal.ToDecimal - ComCartaPorte.Mercancias.NumTotalMercancias = Carta.Mercancias.NumTotalMercancias - ComCartaPorte.Mercancias.CargoPorTasacion = Carta.Mercancias.CargoporTasacion.ToDecimal - ' ComCartaPorte.Mercancias.UnidadPeso = Carta.Mercancias.UnidadPeso + 'MERCANCIAS + If Carta.Mercancias IsNot Nothing Then + ComCartaPorte.Mercancias = New ProfactCartaPorte.CartaPorteMercancias + ComCartaPorte.Mercancias.PesoBrutoTotal = Carta.Mercancias.PesoBrutoTotal.ToDecimal + ComCartaPorte.Mercancias.PesoNetoTotal = Carta.Mercancias.PesoNetoTotal.ToDecimal + ComCartaPorte.Mercancias.NumTotalMercancias = Carta.Mercancias.NumTotalMercancias + ComCartaPorte.Mercancias.CargoPorTasacion = Carta.Mercancias.CargoporTasacion.ToDecimal + ' ComCartaPorte.Mercancias.UnidadPeso = Carta.Mercancias.UnidadPeso - If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then + If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then + Dim i As Integer = 0 + ComCartaPorte.Mercancias.Mercancia = New ProfactCartaPorte.CartaPorteMercanciasMercancia(Carta.Mercancias.Mercancias.Count - 1) {} + For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias + ComCartaPorte.Mercancias.Mercancia(i) = New ProfactCartaPorte.CartaPorteMercanciasMercancia + + If concep.BienesTransp <> "" Then + ComCartaPorte.Mercancias.Mercancia(i).BienesTransp = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ClaveProdServCP), "Item" & concep.BienesTransp), ProfactCartaPorte.c_ClaveProdServCP) + ComCartaPorte.Mercancias.Mercancia(i).BienesTranspSpecified = True + End If + If concep.ClaveSTCC <> "" Then + ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCCSpecified = True + ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCC = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ClaveProdSTCC), "Item" & concep.ClaveSTCC), ProfactCartaPorte.c_ClaveProdSTCC) + End If + + ComCartaPorte.Mercancias.Mercancia(i).Descripcion = concep.Descripción + ComCartaPorte.Mercancias.Mercancia(i).Cantidad = concep.Cantidad + ComCartaPorte.Mercancias.Mercancia(i).ClaveUnidadSpecified = False + ComCartaPorte.Mercancias.Mercancia(i).Unidad = concep.Unidad + ComCartaPorte.Mercancias.Mercancia(i).Dimensiones = concep.Dimensiones + If concep.ClaveMaterialPeligroso <> "" Then + ComCartaPorte.Mercancias.Mercancia(i).MaterialPeligrosoSpecified = True + ComCartaPorte.Mercancias.Mercancia(i).CveMaterialPeligrosoSpecified = True + End If + If concep.Embalaje <> "" Then + ComCartaPorte.Mercancias.Mercancia(i).EmbalajeSpecified = True + ComCartaPorte.Mercancias.Mercancia(i).Embalaje = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoEmbalaje), "Item" & concep.Embalaje), ProfactCartaPorte.c_TipoEmbalaje) + End If + ComCartaPorte.Mercancias.Mercancia(i).DescripEmbalaje = concep.DescripEmbalaje + ComCartaPorte.Mercancias.Mercancia(i).PesoEnKg = concep.PesoenKg + ComCartaPorte.Mercancias.Mercancia(i).ValorMercanciaSpecified = False + ComCartaPorte.Mercancias.Mercancia(i).MonedaSpecified = False + ComCartaPorte.Mercancias.Mercancia(i).FraccionArancelariaSpecified = False + ComCartaPorte.Mercancias.Mercancia(i).UUIDComercioExt = concep.UUIDComercioExt + i += 1 + Next + End If + End If + + ' + If Carta.FiguraTransporte IsNot Nothing Then + + If Carta.FiguraTransporte.AutoTransporteFederal IsNot Nothing Then + ComCartaPorte.FiguraTransporte = New ProfactCartaPorte.CartaPorteFiguraTransporte + + ComCartaPorte.FiguraTransporte.CveTransporte = ProfactCartaPorte.c_CveTransporte.Item02 + ComCartaPorte.Mercancias.AutotransporteFederal = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederal + If Carta.FiguraTransporte.AutoTransporteFederal.PermSCT <> "" Then + ComCartaPorte.Mercancias.AutotransporteFederal.PermSCT = CType([Enum].Parse(GetType(ProfactCartaPorte.c_TipoPermiso), Carta.FiguraTransporte.AutoTransporteFederal.PermSCT), ProfactCartaPorte.c_TipoPermiso) + End If + ComCartaPorte.Mercancias.AutotransporteFederal.NumPermisoSCT = Carta.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT + ComCartaPorte.Mercancias.AutotransporteFederal.NombreAseg = Carta.FiguraTransporte.AutoTransporteFederal.NombreAseg + ComCartaPorte.Mercancias.AutotransporteFederal.NumPolizaSeguro = Carta.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro + + Dim ConfigVehicular As New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalIdentificacionVehicular + ConfigVehicular.ConfigVehicular = CType([Enum].Parse(GetType(ProfactCartaPorte.c_ConfigAutotransporte), Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular), ProfactCartaPorte.c_ConfigAutotransporte) + ConfigVehicular.AnioModeloVM = Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM + ConfigVehicular.PlacaVM = Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM + + ComCartaPorte.Mercancias.AutotransporteFederal.IdentificacionVehicular = ConfigVehicular + + If Carta.FiguraTransporte.AutoTransporteFederal.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporteFederal.Remolques.Count > 0 Then Dim i As Integer = 0 - ComCartaPorte.Mercancias.Mercancia = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercanciasMercancia(Carta.Mercancias.Mercancias.Count - 1) {} - For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias - ComCartaPorte.Mercancias.Mercancia(i) = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteMercanciasMercancia - ComCartaPorte.Mercancias.Mercancia(i).BienesTranspSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).ClaveSTCCSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).Descripcion = concep.Descripción - ComCartaPorte.Mercancias.Mercancia(i).Cantidad = concep.Cantidad - ComCartaPorte.Mercancias.Mercancia(i).ClaveUnidadSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).Unidad = concep.Unidad - ComCartaPorte.Mercancias.Mercancia(i).Dimensiones = concep.Dimensiones - ComCartaPorte.Mercancias.Mercancia(i).MaterialPeligrosoSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).CveMaterialPeligrosoSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).EmbalajeSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).DescripEmbalaje = concep.DescripEmbalaje - ComCartaPorte.Mercancias.Mercancia(i).PesoEnKg = concep.PesoenKg - ComCartaPorte.Mercancias.Mercancia(i).ValorMercanciaSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).MonedaSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).FraccionArancelariaSpecified = False - ComCartaPorte.Mercancias.Mercancia(i).UUIDComercioExt = concep.UUIDComercioExt - - 'cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, concep.Embalaje, concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt) + ComCartaPorte.Mercancias.AutotransporteFederal.Remolques = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalRemolque(Carta.FiguraTransporte.AutoTransporteFederal.Remolques.Count - 1) {} + For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporteFederal.Remolques + ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i) = New ProfactCartaPorte.CartaPorteMercanciasAutotransporteFederalRemolque + ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i).SubTipoRem = CType([Enum].Parse(GetType(ProfactCartaPorte.c_SubTipoRem), concep.SubTipoRemolque), ProfactCartaPorte.c_SubTipoRem) + ComCartaPorte.Mercancias.AutotransporteFederal.Remolques(i).Placa = concep.Placa + i += 1 Next + ' End If End If - ' - If Carta.FiguraTransporte IsNot Nothing Then + If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then + Dim i As Integer = 0 + ComCartaPorte.FiguraTransporte.Operadores = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador(Carta.FiguraTransporte.Operadores.Count - 1) {} + 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).NumLicencia = concep.NumLicencia + ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreOperador + ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribOperador + 'OComCartaPorte.FiguraTransporte.Operadores(i)(0) = concep.ResidenciaFiscalOperador 'falta - If Carta.FiguraTransporte.AutoTransporteFederal IsNot Nothing Then - ComCartaPorte.FiguraTransporte = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporte - - ComCartaPorte.FiguraTransporte.CveTransporte = Profact.TimbraCFDI33.Complementos.CartaPorte10.c_CveTransporte.Item02 - 'ComCartaPorte.FiguraTransporte.CveTransporte. - - 'cfdi.CartaPorteAutotransporteFederal(Carta.FiguraTransporte.AutoTransporteFederal.PermSCT, Carta.FiguraTransporte.AutoTransporteFederal.NumPermisoSCT, Carta.FiguraTransporte.AutoTransporteFederal.NombreAseg, Carta.FiguraTransporte.AutoTransporteFederal.NumPolizaSeguro) - - 'cfdi.CartaPorteIdentificacionVehicular(Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.ConfigVehicular, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.PlacaVM, Carta.FiguraTransporte.AutoTransporteFederal.Vehiculo.AnioModeloVM) - - 'If Carta.FiguraTransporte.AutoTransporteFederal.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporteFederal.Remolques.Count > 0 Then - 'For Each concep As CFDICartaPorteRemolque In Carta.FiguraTransporte.AutoTransporteFederal.Remolques - 'cfdi.CartaPorteRemolque(concep.SubTipoRemolque, concep.Placa) - ' Next - ' - 'End If - End If + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperadorDomicilio() + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Calle = concep.Domicilio.Calle + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.CodigoPostal = "25350" 'concep.Domicilio.CP + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Colonia = "0347" + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Estado = "COA" + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Localidad = "23" + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Municipio = "004" + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.NumeroExterior = "728" + ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio.Pais = ProfactCartaPorte.c_Pais.MEX - 'If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then - ' Dim i As Integer = 0 - ' ComCartaPorte.FiguraTransporte.Operadores = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporteOperadoresOperador(Carta.FiguraTransporte.Operadores.Count - 1)() {} - ' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores - ' Dim Oper = New Profact.TimbraCFDI33.Complementos.CartaPorte10.CartaPorteFiguraTransporteOperadoresOperador() - ' Oper.RFCOperador = concep.RFCOperador - ' Oper.NumLicencia = concep.NumLicencia - ' Oper.NombreOperador = concep.NombreOperador - ' Oper.NumRegIdTribOperador = concep.NumRegidTribOperador - ' 'Oper.ResidenciaFiscalOperador = concep.ResidenciaFiscalOperador - ' ComCartaPorte.FiguraTransporte.Operadores - ' 'cfdi.CartaPorteOperador(concep.RFCOperador, concep.NumLicencia, concep.NombreOperador, concep.NumRegidTribOperador, concep.ResidenciaFiscalOperador) - ' Next - 'End If - + i += 1 + Next End If End If + Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces() + nsComp.Add("CartaPorte", "http://www.sat.gob.mx/CartaPorte") + Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComCartaPorte, GetType(ProfactCartaPorte.CartaPorte), nsComp) + Dim docComp As New XmlDocument() + docComp.LoadXml(xmlComp) + comprobante.CartaPorteSpecified = True + LXmlComplementos.Add(docComp.DocumentElement) + TieneComplemento = True + End If #End Region -#Region "Nomina12" +#Region " Nomina12" If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then Dim Nom = New Profact.TimbraCFDI33.Complementos.Nomina12.Nomina() 'cfdi.Esquema.AgregarEsquema("http://www.sat.gob.mx/nomina12 http://www.sat.gob.mx/sitio_internet/cfd/nomina/nomina12.xsd") diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 5f30eea0e..fdc3a076d 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -595,8 +595,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState End If DtRetorno = dt.FiltraParametros(String.Format("NombreComercial like '%{0}%' OR Nombre like '%{0}%' ", Name)) + dt.Dispose() End If - dt.Dispose() + End If If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then @@ -617,6 +618,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState context.Response.Write("[]") End If DtRetorno.Dispose() + DtRetorno = Nothing Return retorno End Function @@ -671,10 +673,11 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState retorno = JsonConvert.SerializeObject(DtRetorno).ToString context.Response.Write(retorno) DtRetorno.Dispose() + DtRetorno = Nothing Else context.Response.Write("[]") End If - DtRetorno.Dispose() + Return retorno End Function #End Region @@ -946,6 +949,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString context.Response.Write(retorno) DtPSRetorno.Dispose() + DtPSRetorno = Nothing Else context.Response.Write("[]") End If diff --git a/Bin/GoCfdi.dll b/Bin/GoCfdi.dll index f6da1e75a..0fb132ef3 100644 Binary files a/Bin/GoCfdi.dll and b/Bin/GoCfdi.dll differ diff --git a/Bin/Profact.TimbraCFDI.dll b/Bin/Profact.TimbraCFDI.dll index 5acf6f2f6..32a95ef3a 100644 Binary files a/Bin/Profact.TimbraCFDI.dll and b/Bin/Profact.TimbraCFDI.dll differ diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 27585e0ea..7a895576b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2358,16 +2358,16 @@ Partial Class Compras_Compras CveTipoPS = PSS.Rows(0)("CveTipoPS").ToString.ToEntero End If - Dim Cantidad As Double = 1 + Dim Cantidad As Decimal = 1 Dim CveSubProyectoContrato As String = "-1" Dim CveProyecto As String = "-1" Dim SubProyecto As String = "SE" Dim Proyecto As String = "SE" Dim Obs As String = "" - Dim PU As Double = IEPS - Dim Total As Double = Cantidad * PU - Dim IVA As Double = 0 - Dim Descuento As Double = 0 + Dim PU As Decimal = IEPS + Dim Total As Decimal = Cantidad * PU + Dim IVA As Decimal = 0 + Dim Descuento As Decimal = 0 If PSS2.Rows.Count > 0 Then CveUM = PSS2.Rows(0)("CveUM").ToString.ToEntero @@ -3539,7 +3539,7 @@ Partial Class Compras_Compras Dim Total As Decimal = 0 Dim PU As Decimal = 0 - Dim Descuento As Double = 0 + Dim Descuento As Decimal = 0 Dim CveUM As Integer = 0 Dim UMM As String = "No Aplica" Dim tCvePS As Integer = 0 @@ -3551,14 +3551,14 @@ Partial Class Compras_Compras Dim PSS As String = "" Dim Obs As String = "" Dim SubTotalTemp = 0.0D - Dim IVA As Double = 0 - Dim IEPS As Double = 0 - Dim RetISR As Double = 0 - Dim RetIVA As Double = 0 - Dim PorcentajeIVA As Double = 0 - Dim PorcentajeIEPS As Double = 0 - Dim PorcentajeRetISR As Double = 0 - Dim PorcentajeRetIVA As Double = 0 + Dim IVA As Decimal = 0 + Dim IEPS As Decimal = 0 + Dim RetISR As Decimal = 0 + Dim RetIVA As Decimal = 0 + Dim PorcentajeIVA As Decimal = 0 + Dim PorcentajeIEPS As Decimal = 0 + Dim PorcentajeRetISR As Decimal = 0 + Dim PorcentajeRetIVA As Decimal = 0 Dim DtTemporalGuardados = New DataTable DtTemporalGuardados.Columns.Add("Contador", GetType(Integer)) DtTemporalGuardados.Columns.Add("Tipo", GetType(Integer)) @@ -3622,7 +3622,7 @@ Partial Class Compras_Compras If ValorXML(node, "cantidad").ToDecimal > 0 AndAlso ValorXML(node, "valorUnitario").ToDecimal >= (ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal) Then PU = ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal End If - If ValorXML(node, "cantidad").ToDecimal > 0 AndAlso ValorXML(node, "valorUnitario").ToDouble <= 0 And ValorXML(node, "importe").ToDouble > 0 Then + If ValorXML(node, "cantidad").ToDecimal > 0 AndAlso ValorXML(node, "valorUnitario").ToDecimal <= 0 And ValorXML(node, "importe").ToDecimal > 0 Then PU = ValorXML(node, "importe").ToDecimal / ValorXML(node, "cantidad").ToDecimal End If @@ -3630,7 +3630,7 @@ Partial Class Compras_Compras 'OBTIENE DESCUENTO - If ValorXML(node, "descuento") IsNot Nothing Then Descuento = ValorXML(node, "descuento").Trim.ToDouble + If ValorXML(node, "descuento") IsNot Nothing Then Descuento = ValorXML(node, "descuento").Trim.ToDecimal 'OBTIENE TOTAL If ValorXML(node, "importe") IsNot Nothing Then Total = ValorXML(node, "importe").Trim.ToDecimal @@ -3820,7 +3820,7 @@ Partial Class Compras_Compras '' AGREGA PS 'AGREGA A TMPDT - AddPS(ValorXML(node, "cantidad").ToDouble, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS) + AddPS(ValorXML(node, "cantidad").ToDecimal, CveUM, UMM, tCveClasif, Clasif, tCvePS, PSS, TipoPS, "-1", "SE", "SE", "-1", Obs, PU, Total, IVA, RetIVA, RetISR, IEPS, 0, Descuento, PSCodigo:=tPSCodigo, TCalculaTotales:=False, CveSATPS:=ValorXML(node, "ClaveProdServ").ToEntero(), CargaXml:=True, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, PorcentajeRetISR:=PorcentajeRetISR, PorcentajeIEPS:=PorcentajeIEPS) @@ -5117,13 +5117,13 @@ Partial Class Compras_Compras 'AGREGA COMPRA DETALLE If Not ObjCompras.AddCompraDetalle(CveCompra, Row("CveUM").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, -1, CveAF, - Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble, Row("Descuento").ToString.ToDouble, + Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal, Row("IVA").ToString.ToDecimal, Row("Total").ToString.ToDecimal, Row("Descuento").ToString.ToDecimal, Row("Obs").ToString, Row("CveOrdenCompraDetalle").ToString.ToEntero, TipoRecepcion, Row("CveContrato").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, AplicaCostoIndirecto:=Row("AplicaCostoIndirecto").ToString.ToEntero, EstatusAlmacen:=Row("EntregaDirecta").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, OtrosGastos:=Row("OtrosGastos").ToString.ToDecimal, - RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble.RoundSQL, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, - IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, - IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), + RetIVA:=Row("RetIVA").ToString.ToDecimal, RetISR:=Row("RetISR").ToString.ToDecimal, IEPSPS:=Row("IEPSPS").ToString.ToDecimal.RoundSQL, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDecimal, + IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDecimal, + IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDecimal, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CveCultivoCuadroDetalle:=Row("CveCultivoCuadroDetalle").ToString.ToEntero) Then ErrorDetalles = True @@ -10258,13 +10258,13 @@ Partial Class Compras_Compras End If If Not ObjCompra.AddCompraDetalle(CveCompra, Row("CveUM").ToString.ToEntero, Row("CvePS").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, -1, CveAF, - Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble, Row("Descuento").ToString.ToDouble, + Row("Cantidad").ToString.ToDecimal, Row("PU").ToString.ToDecimal, Row("IVA").ToString.ToDecimal, Row("Total").ToString.ToDecimal, Row("Descuento").ToString.ToDecimal, Row("Obs").ToString, Row("CveOrdenCompraDetalle").ToString.ToEntero, TipoRecepcion, Row("CveContrato").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, AplicaCostoIndirecto:=Row("AplicaCostoIndirecto").ToString.ToEntero, EstatusAlmacen:=Row("EntregaDirecta").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, OtrosGastos:=Row("OtrosGastos").ToString.ToDecimal, - RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble.RoundSQL, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, - IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, - IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), + RetIVA:=Row("RetIVA").ToString.ToDecimal, RetISR:=Row("RetISR").ToString.ToDecimal, IEPSPS:=Row("IEPSPS").ToString.ToDecimal.RoundSQL, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDecimal, + IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDecimal, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDecimal, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDecimal, + IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDecimal, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDecimal, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CveCultivoCuadroDetalle:=Row("CveCultivoCuadroDetalle").ToString.ToEntero) Then Retorno = False @@ -15111,22 +15111,22 @@ Partial Class Compras_Compras Dim CveTipoPS As Integer = dr("CveTipoPS").ToString.ToEntero Dim Proyecto As String = dr("Proyecto").ToString Dim Obs As String = dr("Obs").ToString - Dim PU As Double = dr("PU").ToString.ToDouble - Dim IVA As Double = dr("IVA").ToString.ToDouble - Dim RetIVA As Double = dr("RetIVA").ToString.ToDouble - Dim RetISR As Double = dr("RetISR").ToString.ToDouble - Dim IEPSPS As Double = dr("IEPSPSPorcentaje").ToString.ToDouble - Dim IEPSPSIVA As Double = If(dr("IEPSGrabaIVA").ToString = "True", dr("IEPSPorcentaje").ToString.ToDouble, 0) - Dim Descuento As Double = dr("Descuento").ToString.ToDouble + Dim PU As Decimal = dr("PU").ToString.ToDecimal + Dim IVA As Decimal = dr("IVA").ToString.ToDecimal + Dim RetIVA As Decimal = dr("RetIVA").ToString.ToDecimal + Dim RetISR As Decimal = dr("RetISR").ToString.ToDecimal + Dim IEPSPS As Decimal = dr("IEPSPSPorcentaje").ToString.ToDecimal + Dim IEPSPSIVA As Decimal = If(dr("IEPSGrabaIVA").ToString = "True", dr("IEPSPorcentaje").ToString.ToDecimal, 0) + Dim Descuento As Decimal = dr("Descuento").ToString.ToDecimal Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero For Each cadena As String In porcentajes Dim valores As String() = cadena.Split(New Char() {","c}) - Dim Cantidad As Double = dr("Cantidad").ToString.ToDouble * (valores(1).ToDouble / 100) + Dim Cantidad As Decimal = dr("Cantidad").ToString.ToDecimal * (valores(1).ToDecimal / 100) Dim CveSubProyectoContrato As String = valores(0) Dim CveProyecto As String = valores(0) - Dim Total As Double = Cantidad * PU + Dim Total As Decimal = Cantidad * PU Dim drT As DataRow = GBSP.FiltroPrimero(String.Format("CveSubProyecto = {0} ", CveSubProyectoContrato)) Dim drq As DataRow = GBSP.FiltroPrimero(String.Format("CveProyecto = {0} ", CveProyecto)) Dim SubProyecto As String = drT("SubProyecto").ToString @@ -15414,14 +15414,14 @@ Partial Class Compras_Compras DivTipoCambioOC.Visible = False End If - DTOCTemp.Columns.Add("PUTC", GetType(Double)) - DTOCTemp.Columns.Add("TotalTC", GetType(Double)) - DTOCTemp.Columns.Add("DescuentoTC", GetType(Double)) - DTOCTemp.Columns.Add("IVATC", GetType(Double)) - DTOCTemp.Columns.Add("IEPSPSTC", GetType(Double)) - DTOCTemp.Columns.Add("IEPSPSIVATC", GetType(Double)) - DTOCTemp.Columns.Add("RetIVATC", GetType(Double)) - DTOCTemp.Columns.Add("RetISRTC", GetType(Double)) + DTOCTemp.Columns.Add("PUTC", GetType(Decimal)) + DTOCTemp.Columns.Add("TotalTC", GetType(Decimal)) + DTOCTemp.Columns.Add("DescuentoTC", GetType(Decimal)) + DTOCTemp.Columns.Add("IVATC", GetType(Decimal)) + DTOCTemp.Columns.Add("IEPSPSTC", GetType(Decimal)) + DTOCTemp.Columns.Add("IEPSPSIVATC", GetType(Decimal)) + DTOCTemp.Columns.Add("RetIVATC", GetType(Decimal)) + DTOCTemp.Columns.Add("RetISRTC", GetType(Decimal)) DTOCTemp.Columns.Add("FolioAlmacen", GetType(String)) For Each Dr As DataRow In DTOCTemp.Rows Dr("PUTC") = Dr("Importe") @@ -15855,11 +15855,11 @@ Partial Class Compras_Compras 'Dim IEPSPS As Double = gvr.FCHiddenField("HdnOC1IEPSImporte").Value.ToDecimal 'Dim IEPSPSIVA As Double = gvr.FCHiddenField("HdnOC1IEPSIVA").Value.ToDecimal Dim IVA As Decimal = dr("IVAPorcentaje").ToString.ToDecimal - Dim RetIVA As Double = dr("RetIVAPorcentaje").ToString.ToDecimal - Dim RetISR As Double = dr("RetISRPorcentaje").ToString.ToDecimal - Dim IEPSPS As Double = dr("IEPSPSPorcentaje").ToString.ToDecimal - Dim IEPSPSIVA As Double = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal - Dim Descuento As Double = If(TieneAmortizacion, TxtDescuento.Text.ToDouble / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal) + Dim RetIVA As Decimal = dr("RetIVAPorcentaje").ToString.ToDecimal + Dim RetISR As Decimal = dr("RetISRPorcentaje").ToString.ToDecimal + Dim IEPSPS As Decimal = dr("IEPSPSPorcentaje").ToString.ToDecimal + Dim IEPSPSIVA As Decimal = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal + Dim Descuento As Decimal = If(TieneAmortizacion, TxtDescuento.Text.ToDecimal / TotalRows, gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal) 'Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero @@ -16037,7 +16037,7 @@ Partial Class Compras_Compras OCVinculada = True UpPSS.Update() - AsignaValoresOriginales(TxtSubTotal.Text.ToDouble, TxtSubTotal2.Text.ToDouble, TxtIVA.Text.ToDouble, TxtRetIVA.Text.ToDouble, TxtRetISR.Text.ToDouble, TxtTotal.Text.ToDouble) + AsignaValoresOriginales(TxtSubTotal.Text.ToDecimal, TxtSubTotal2.Text.ToDecimal, TxtIVA.Text.ToDecimal, TxtRetIVA.Text.ToDecimal, TxtRetISR.Text.ToDecimal, TxtTotal.Text.ToDecimal) CargaGvInv() @@ -16122,11 +16122,11 @@ Partial Class Compras_Compras Dim Total As Decimal = gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal Dim IVA As Decimal = dr("IVAPorcentaje").ToString.ToDecimal - Dim RetIVA As Double = dr("RetIVAPorcentaje").ToString.ToDecimal - Dim RetISR As Double = dr("RetISRPorcentaje").ToString.ToDecimal - Dim IEPSPS As Double = dr("IEPSPSPorcentaje").ToString.ToDecimal - Dim IEPSPSIVA As Double = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal - Dim Descuento As Double = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal + Dim RetIVA As Decimal = dr("RetIVAPorcentaje").ToString.ToDecimal + Dim RetISR As Decimal = dr("RetISRPorcentaje").ToString.ToDecimal + Dim IEPSPS As Decimal = dr("IEPSPSPorcentaje").ToString.ToDecimal + Dim IEPSPSIVA As Decimal = dr("IEPSPSIVAPorcentaje").ToString.ToDecimal + Dim Descuento As Decimal = gvr.FCHiddenField("HdnOC1Descuento").Value.ToDecimal Dim CveOrdenCompraDetalle As Integer = dr("CveOrdenCompraDetalle").ToString.ToEntero Dim EntregaDirecta As Integer = dr("EntregaDirecta").ToString.ToEntero Dim CveSATPS As Integer = gvr.FCDropDownLost("DdlSATPS").SelectedValue.ToEntero @@ -16211,7 +16211,7 @@ Partial Class Compras_Compras CargaVinculacionOC() End Sub Protected Sub BtnDividirCompra_Click(sender As Object, e As EventArgs) - Dim Cantidad = CType(CType(sender, Button).NamingContainer, GridViewRow).FCTextBox("TxtDividir").Text.ToDouble + Dim Cantidad = CType(CType(sender, Button).NamingContainer, GridViewRow).FCTextBox("TxtDividir").Text.ToDecimal If Cantidad < 0.1 Then Exit Sub @@ -16222,10 +16222,10 @@ Partial Class Compras_Compras drNuevo.ItemArray = dr.ItemArray drNuevo("Cantidad") = Cantidad - drNuevo("Total") = drNuevo("Cantidad").ToString.ToEntero * drNuevo("PU").ToString.ToDouble + drNuevo("Total") = drNuevo("Cantidad").ToString.ToEntero * drNuevo("PU").ToString.ToDecimal dr("Cantidad") = dr("Cantidad").ToString.ToEntero - Cantidad - dr("Total") = dr("Cantidad").ToString.ToEntero * dr("PU").ToString.ToDouble + dr("Total") = dr("Cantidad").ToString.ToEntero * dr("PU").ToString.ToDecimal TmpDT.Rows.InsertAt(drNuevo, CType(CType(sender, Button).NamingContainer, GridViewRow).RowIndex) @@ -18173,15 +18173,15 @@ Partial Class Compras_Compras If PSRow IsNot Nothing Then SATClavePS = PSRow("SATClavePS").ToString.ToEntero End If - Dim IVA As Double + Dim IVA As Decimal If chkImportacion.Checked Then - IVA = (txtImportacion.Text.Trim.ToDouble / (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.Trim.ToDouble)) + IVA = (txtImportacion.Text.Trim.ToDecimal / (TxtCantidad.Text.Trim.ToDecimal * TxtPrecio.Text.Trim.ToDecimal)) Else - IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) + IVA = Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) End If - AddPS(TxtCantidad.Text.Trim.ToDouble, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, - DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDouble, Total, IVA, - TxtRetIVAModal.Text.ToDouble / 100, TxtRetISRModal.Text.ToDouble / 100, TxtIEPSModal.Text.ToDouble / 100, 0, TxtDescuentoModal.Text.ToDouble, OtrosGastos:=TxtOtrosGastos.Text.ToDouble, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, + AddPS(TxtCantidad.Text.Trim.ToDecimal, ddlUM.SelectedValue.ToEntero, ddlUM.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, DdlPS.SelectedValue.ToEntero, DdlPS.SelectedText, HdnTipoPS.Value.ToEntero, + DdlSubProyecto.SelectedValue.ToString, DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToString, TxtObsPS.Text.Trim, TxtPrecio.Text.Trim.ToDecimal, Total, IVA, + TxtRetIVAModal.Text.ToDecimal / 100, TxtRetISRModal.Text.ToDecimal / 100, TxtIEPSModal.Text.ToDecimal / 100, 0, TxtDescuentoModal.Text.ToDecimal, OtrosGastos:=TxtOtrosGastos.Text.ToDecimal, CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, TipoGasto:=DdlTipoGasto.SelectedItem.Text, NoDeducible:=ChkEsNoDeduciblePS.Checked, CveSATPS:=SATClavePS, CveContratoDetalle:=CveContratoDetalle) AddPS2() @@ -18218,11 +18218,11 @@ Partial Class Compras_Compras ''' Regresa el INDEX del row que acaba de agregar en el TMPDT ''' ''' - Private Function AddPS(Cantidad As Double, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveTipoPS As Integer, CveSubProyectoContrato As String, SubProyecto As String, Proyecto As String, CveProyecto As String, - Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True, - Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0, - Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0, - Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveSATPSActualizado As Boolean = False) As Integer + Private Function AddPS(Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, CveTipoPS As Integer, CveSubProyectoContrato As String, SubProyecto As String, Proyecto As String, CveProyecto As String, + Obs As String, PU As Decimal, Total As Decimal, IVA As Decimal, RetIVA As Decimal, RetISR As Decimal, IEPSPS As Decimal, IEPSPSIVA As Decimal, Descuento As Decimal, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True, + Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Decimal = 0, + Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Decimal = 0, + Optional PorcentajeIEPS As Decimal = 0, Optional PorcentajeRetIVA As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, Optional CveSATPSActualizado As Boolean = False) As Integer Dim Row As DataRow = Nothing @@ -18329,17 +18329,17 @@ Partial Class Compras_Compras Row("IEPSPSPorcentaje") = PorcentajeIEPS Else 'If DdlIVA.SelectedValue.ToDouble = 0 Then Row("IVA") = 0 Else Row("IVA") = Math.Round(IVA * Total, DecimalesPermitidos) - Row("IVA") = Math.Round(IVA * Total, 2) + Row("IVA") = (IVA * Total).RoundSQL Row("IVAPorcentaje") = IVA - Row("RetIVA") = Math.Round(RetIVA * Total, 2) + Row("RetIVA") = (RetIVA * Total).RoundSQL Row("RetIVAPorcentaje") = RetIVA - Row("RetISR") = Math.Round(RetISR * Total, 2) + Row("RetISR") = (RetISR * Total).RoundSQL Row("RetISRPorcentaje") = RetISR - Row("IEPSPS") = Math.Round(IEPSPS * Total, 2) + Row("IEPSPS") = (IEPSPS * Total).RoundSQL Row("IEPSPSPorcentaje") = IEPSPS End If - Row("ImporteConImpuestos") = (Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble) + Row("IVA").ToString.ToDouble + Row("IEPSPS").ToString.ToDouble - (Row("RetIVA").ToString.ToDouble + Row("RetISR").ToString.ToDouble) - Row("ImporteSinImpuestos") = Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble + Row("ImporteConImpuestos") = (Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal) + Row("IVA").ToString.ToDecimal + Row("IEPSPS").ToString.ToDecimal - (Row("RetIVA").ToString.ToDecimal + Row("RetISR").ToString.ToDecimal) + Row("ImporteSinImpuestos") = Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal Row("IEPSPSIVA") = Math.Round(IEPSPSIVA * Total, DecimalesPermitidos) Row("IEPSPSIVAPorcentaje") = IEPSPSIVA @@ -18480,23 +18480,23 @@ Partial Class Compras_Compras 'IMPUESTOS: SI ES COMPRA, FACUTRA O CON OC, NO MODIFICA IMPUESTOS!! 'Dim IVA = (TxtIVAModal.Text.ToDouble / 100) - Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) - Dim RetISR = (TxtRetISRModal.Text.ToDouble / 100) - Dim RetIVA = (TxtRetIVAModal.Text.ToDouble / 100) - Dim IEPSPS = (TxtIEPSModal.Text.ToDouble / 100) + Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2) + Dim RetISR = (TxtRetISRModal.Text.ToDecimal / 100) + Dim RetIVA = (TxtRetIVAModal.Text.ToDecimal / 100) + Dim IEPSPS = (TxtIEPSModal.Text.ToDecimal / 100) Dim IEPSPSIVA = 0 'I f Not (CveCompra > 0 Or CveFactura > 0 Or OCVinculada) Then 'If DdlIVA.SelectedValue.ToDouble = 0 Then DrPS("IVA") = 0 Else DrPS("IVA") = IVA * Total - DrPS("IVA") = IVA * Total + DrPS("IVA") = (IVA * Total).RoundSQL DrPS("IVAPorcentaje") = IVA - DrPS("RetIVA") = RetIVA * Total + DrPS("RetIVA") = (RetIVA * Total).RoundSQL DrPS("RetIVAPorcentaje") = RetIVA DrPS("RetISR") = RetISR * Total DrPS("RetISRPorcentaje") = RetISR - DrPS("IEPSPS") = IEPSPS * Total + DrPS("IEPSPS") = (IEPSPS * Total).RoundSQL DrPS("IEPSPSPorcentaje") = IEPSPS - DrPS("IEPSPSIVA") = IEPSPSIVA * Total + DrPS("IEPSPSIVA") = (IEPSPSIVA * Total).RoundSQL DrPS("IEPSPSIVAPorcentaje") = IEPSPSIVA @@ -20927,9 +20927,9 @@ Partial Class Compras_Compras Dim Proyecto As String = GvRow.DataKey("Proyecto") Dim CveProyecto As Integer = GvRow.DataKey("CveProyecto").ToEntero - Dim RetISR As Double = GvRow.DataKey("RetISR").ToString.ToDouble - Dim RetIVA As Double = GvRow.DataKey("RetIVA").ToString.ToDouble - Dim IvaPS As Double = GvRow.DataKey("IVA").ToString.ToDouble + Dim RetISR As Decimal = GvRow.DataKey("RetISR").ToString.ToDecimal + Dim RetIVA As Decimal = GvRow.DataKey("RetIVA").ToString.ToDecimal + Dim IvaPS As Decimal = GvRow.DataKey("IVA").ToString.ToDecimal If IvaPS = -1 Then IvaPS = PorcentajeIVA @@ -20940,8 +20940,8 @@ Partial Class Compras_Compras Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToString.ToEntero Dim Clasificacion As String = GvRow.DataKey("Clasificacion") - Dim IEPSPS As Double = GvRow.DataKey("IEPSPorcentaje").ToString.ToDouble - Dim IEPSPSIVA As Double = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0) + Dim IEPSPS As Decimal = GvRow.DataKey("IEPSPorcentaje").ToString.ToDecimal + Dim IEPSPSIVA As Decimal = If(GvRow.DataKey("IEPSGrabaIVA").ToString = "True", IEPSPS, 0) If Cantidad > 0 Then diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx index 419a93c51..3cbdd83d6 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx +++ b/Contabilidad2/CatCuentasAsignaciones.aspx @@ -91,18 +91,13 @@
- - - - - - + diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb index 747c43556..9818cb0fc 100644 --- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb +++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb @@ -58,7 +58,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones Dim ObjConta As New ClsContabilidad If ObjConta.GetConta_ConceptosContables() Then - DdlCconceptosContables.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True ") + DdlCconceptosContables.DataSource = ObjConta.DtResultados.FiltraParametros("EsSistema = True ") DdlConceptoGlobal.DataSource = ObjConta.DtResultados.FiltraParametros("EsCuentaUnica = false AND EsSistema = True AND EsGlobal = True") End If diff --git a/General/PopUpPaqueteriasGuias.aspx.cs b/General/PopUpPaqueteriasGuias.aspx.cs index 8b76b39b9..ec353c294 100644 --- a/General/PopUpPaqueteriasGuias.aspx.cs +++ b/General/PopUpPaqueteriasGuias.aspx.cs @@ -741,7 +741,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas private string DocumentoEntregaInterna() { ClsVentas ObjVentas = new ClsVentas(); - if (ObjVentas.GetVenta(this.CveVenta, UsuarioActual.CveEmpresa)) + if (ObjVentas.GetVenta(this.CveVenta, UsuarioActual.CveEmpresa) && ObjVentas.DtResultados.Rows.Count> 0) { string ClienteNombre = ObjVentas.DtResultados.Rows[0]["ClienteNombre"].ToString(); string FolioVenta = ObjVentas.DtResultados.Rows[0]["SerieFolio"].ToString(); diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 716d296f2..ca07acd2c 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1159,7 +1159,7 @@ Partial Class General_SaldosIniciales CveCompra = ObjCompras.CveCompra 'Compra Detalle - If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero, -1, 0, 1, SubTotal, 0.16, SubTotal, 0, "Carga Inicial", -1) Then + If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero, -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1) Then ErrorCompras = True Exit For End If diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 5a490db33..c622d7ac6 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -778,12 +778,13 @@ Partial Class Inventarios_EntradasSalidas HplDescargaXml.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesXmlTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "XML", $"Tra-{Folio}", "Tra"))) HplDescargaPdf.Visible = True HplDescargaPdf.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimiento, "PDF", $"Tra-{Folio}", "Tra"))) - HplCartaPorte.Visible = True - HplCartaPorte.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimiento))) - If UsuarioActual.CveRol = 1 Then + If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then HplCartaPorteTimbre.Visible = True HplCartaPorteTimbre.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPOTIMBRE&CVEMOV={0}", CveMovimiento))) + Else + HplCartaPorte.Visible = True + HplCartaPorte.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CARPO&CVEMOV={0}", CveMovimiento))) End If diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index f30f86748..8f9eea59c 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -191,6 +191,7 @@ Partial Class Inventarios_TraspasoAlmacen If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then divFechaEnvio.Visible = True + HplNuevaUnidad.Enabled = False End If @@ -212,7 +213,7 @@ Partial Class Inventarios_TraspasoAlmacen DivTransitorio2.Visible = True End If - If UsuarioActual.CveEmpresa.Contiene(1, 119) Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 140, 2) Then DivEmitirTimbrado.Visible = True LblEmitirTimbrado.Visible = True ChkEmitirTimbrado.Checked = True @@ -1164,9 +1165,6 @@ Partial Class Inventarios_TraspasoAlmacen End If - 'DdlClasificacion.SelectedValue = "-1" - 'DdlClasificacion_SelectedIndexChanged(DdlClasificacion, EventArgs.Empty) - If ChkEmitirTimbrado.Checked AndAlso ChkTransitorio.Checked Then CveMovimientoTimbrado = CveMovimientoSalida : Timbrar() Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion, "") @@ -2693,7 +2691,7 @@ Partial Class Inventarios_TraspasoAlmacen Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP Timbre.Comprobante.Confirmacion = "" - Timbre.Receptor.RFC = "XAXX010101000" + Timbre.Receptor.RFC = UsuarioActual.Empresa.RFC Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa Timbre.Receptor.UsoCFDI = "P01" @@ -2710,7 +2708,6 @@ Partial Class Inventarios_TraspasoAlmacen CartaPorte.TranspInternac = "No" CartaPorte.EntradaSalidaMercancia = "" CartaPorte.ViaEntradaSalida = "" - CartaPorte.TotalDistanciaRecorrida = 12 CartaPorte.Mercancias.PesoBrutoTotal = 0 CartaPorte.Mercancias.UnidadPeso = "" @@ -2778,36 +2775,36 @@ Partial Class Inventarios_TraspasoAlmacen If CveSubProyectoOrigen > 0 Then Dim drr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyectoOrigen).FiltroPrimero("") DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drr("Calle").ToString, - .Colonia = drr("Colonia").ToString, - .CP = drr("CP").ToString, - .Estado = drr("Estado").ToString, - .Pais = drr("Pais").ToString, - .Municipio = drr("Municipio").ToString, - .Localidad = drr("Localidad").ToString} + .Colonia = "",'drr("Colonia").ToString, + .CP = drr("CP").ToString, + .Estado = "SON", ' drr("Estado").ToString, + .Pais = "MEX",'drr("Pais").ToString, + .Municipio = "", ' drr("Municipio").ToString, + .Localidad = ""} ' drr("Localidad").ToString} End If Dim CveSubProyectoDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestino.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero Dim DomDestino As CFDICartaPorteDomicilio = Nothing - If CveSubProyectoOrigen > 0 Then - Dim drr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyectoOrigen).FiltroPrimero("") + If CveSubProyectoDestino > 0 Then + Dim drr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyectoDestino).FiltroPrimero("") DomDestino = New CFDICartaPorteDomicilio With {.Calle = drr("Calle").ToString, - .Colonia = drr("Colonia").ToString, - .CP = drr("CP").ToString, - .Estado = drr("Estado").ToString, - .Pais = drr("Pais").ToString, - .Municipio = drr("Municipio").ToString, - .Localidad = drr("Localidad").ToString} + .Colonia = "",'drr("Colonia").ToString, + .CP = drr("CP").ToString, + .Estado = "SON", ' drr("Estado").ToString, + .Pais = "MEX",'drr("Pais").ToString, + .Municipio = "", ' drr("Municipio").ToString, + .Localidad = ""} ' drr("Localidad").ToString} End If Dim Ubica As New CFDICartaPorteUbicaciones - Ubica.TipoEstacion = "01" - Ubica.DistanciaRecorrida = 6 - Ubica.Origen = New CFDICartaPorteUbicacionOrigen With {.RFCRemitente = UsuarioActual.Empresa.RFC, - .FechaHoraSalida = Now.ToString("yyyy-MM-ddTH:mm:ss"),' "2021-08-23T11:13:01", + Ubica.TipoEstacion = "" + Ubica.DistanciaRecorrida = 1 + Ubica.Origen = New CFDICartaPorteUbicacionOrigen With {.RFCRemitente = "",'UsuarioActual.Empresa.RFC, + .FechaHoraSalida = Now.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01", .NombreRemitente = UsuarioActual.Empresa.Empresa, .Domicilio = DomOrigen} - Ubica.Destino = New CFDICartaPorteUbicacionDestino With {.RFCDestinatario = UsuarioActual.Empresa.RFC,'"CAMJ841219I33", + Ubica.Destino = New CFDICartaPorteUbicacionDestino With {.RFCDestinatario = "",'UsuarioActual.Empresa.RFC,'"CAMJ841219I33", .FechaHoraProgLlegada = TxtFechaEntrega.Text.ToDate.ToString("yyyy-MM-ddT23:59:59"), .NombreDestinatario = UsuarioActual.Empresa.Empresa, .Domicilio = DomDestino} @@ -3025,7 +3022,7 @@ Partial Class Inventarios_TraspasoAlmacen 'If TimbrarFacturaGoCFDIv33(ObjFactura, UsuarioActual, 4) <> "" Then ' MensajeAlert.AppendFormat("
  • -- no timbró-{0}
", MensajeErrorCFDI) 'End If - If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura, 3) Then + If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then MensajeAlert.Append("Emitido con exito.") 'XML Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) diff --git a/Planeacion/CatFolios.aspx.vb b/Planeacion/CatFolios.aspx.vb index 5d7011078..3f6d7292f 100644 --- a/Planeacion/CatFolios.aspx.vb +++ b/Planeacion/CatFolios.aspx.vb @@ -71,6 +71,7 @@ Partial Class CatFolios DdlTipoDocto.Items.Insert(32, New ListItem("Acreedor", "Acr")) DdlTipoDocto.Items.Insert(33, New ListItem("Productos/Servicios", "PS")) DdlTipoDocto.Items.Insert(34, New ListItem("NC de Remisión", "RNC")) + DdlTipoDocto.Items.Insert(35, New ListItem("Traspaso Carta Porte", "Tra")) ElseIf UsuarioActual.Empresa.CvePlataforma = 2 Then DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing")) DdlTipoDocto.Items.Insert(2, New ListItem("Notas de Crédito", "Egs")) diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index d3ea5c767..f693e8c54 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -5391,14 +5391,33 @@ Partial Class RH_Personal Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble() Dim Serie As String = TxtLiberarSerie.Text.Trim + Dim Errores As String = "" Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme) - Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=-3, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) - Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero() - Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) - Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) + If CveResultadoSalida > 0 Then + Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=-3, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme) - If ResultadoDetalleSalida And ResultadoDetalleEntrada Then + Dim ResultadoDetalleEntrada As Boolean = False + If ResultadoDetalleSalida Then + Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero() + Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero(), 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme) + If CveResultadoEntrada > 0 Then + ResultadoDetalleEntrada = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie) + If Not ResultadoDetalleEntrada Then + Errores = "No se puede registrar la entrada detallada" + End If + Else + Errores = "No se puede registrar la entrada" + End If + Else + Errores = "No se puede registrar el detalle de salida" + End If + Else + Errores = "No se puede registrar la salida" + End If + + + If Errores = "" Then ObjInventario.Commit() Alert("El resguardo se liberó correctamente") RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme"))