Visualizar intermediario en formato de complemento de pago de VSH
This commit is contained in:
@@ -7321,6 +7321,7 @@ Public Class ClsPaginas
|
||||
Dim Importe = ""
|
||||
Dim TotalLetra = ""
|
||||
Dim FechaRecibo = ""
|
||||
Dim ProveedorIntermediario As String = ""
|
||||
Dim RegimenFiscalCodigo As String = ""
|
||||
Dim CFDIVersion As String = If(UsuarioActual.Empresa.Funcionalidad(350) = "1", "4.0", "3.3")
|
||||
|
||||
@@ -7385,6 +7386,7 @@ Public Class ClsPaginas
|
||||
CveCliente = ObjBancos.DtResultados.FiltroPrimeroValor("CveCliente").ToEntero
|
||||
CveMoneda = ObjBancos.DtResultados.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||
FechaComprobante = ObjBancos.DtResultados.FiltroPrimeroValor("Fecha").ToDate
|
||||
ProveedorIntermediario = ObjBancos.DtResultados.FiltroPrimeroValor("ProveedorIntermediario")
|
||||
SerieFolio = $"{Serie}-{Folio}"
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
@@ -7628,6 +7630,11 @@ Public Class ClsPaginas
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 145 Then
|
||||
params.Add(New ReportParameter("ProveedorIntermediario", ProveedorIntermediario))
|
||||
End If
|
||||
|
||||
If File.Exists($"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc") Then
|
||||
rutaArchivo = $"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc"
|
||||
Else
|
||||
|
||||
@@ -1,176 +1,176 @@
|
||||
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)
|
||||
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.Version = "3.3"
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then ObjFactura.Version = "4.0"
|
||||
|
||||
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"
|
||||
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.UsoCFDI = "S01"
|
||||
If ObjFactura.Version = "3.3" Then 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, Obj.TipoDocto, FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
If ObjGrales.DtResultados.Rows.Count = 1 Then
|
||||
Dim DtMovimientos As DataTable = Nothing
|
||||
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
|
||||
|
||||
Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
|
||||
Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
|
||||
Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
|
||||
|
||||
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
|
||||
|
||||
If ObjFactura.Version = "3.3" Then 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, Obj.TipoDocto, FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
If ObjGrales.DtResultados.Rows.Count = 1 Then
|
||||
Dim DtMovimientos As DataTable = Nothing
|
||||
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
|
||||
|
||||
Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
|
||||
Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
|
||||
Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
|
||||
|
||||
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
|
||||
|
||||
If Obj.DtDetalle IsNot Nothing AndAlso Obj.DtDetalle.Rows.Count > 0 Then
|
||||
If Obj.DtDetalle.MAX("ClaveMaterialPeligroso") <> "" Then
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString
|
||||
@@ -178,43 +178,43 @@ Public Class Timbres
|
||||
End If
|
||||
End If
|
||||
|
||||
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
|
||||
|
||||
If drT("ClaveTipoRemolque1").ToString <> "" Then
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
|
||||
End If
|
||||
|
||||
If drT("ClaveTipoRemolque2").ToString <> "" Then
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
|
||||
End If
|
||||
|
||||
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 NumRegIdTrib As String = ""
|
||||
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
|
||||
|
||||
If drT("ClaveTipoRemolque1").ToString <> "" Then
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
|
||||
End If
|
||||
|
||||
If drT("ClaveTipoRemolque2").ToString <> "" Then
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
|
||||
End If
|
||||
|
||||
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 NumRegIdTrib As String = ""
|
||||
Dim ResidenciaFiscal As String = ""
|
||||
If drT("DestinatarioRFC").ToString.Contiene("XEXX010101000") Then ' cuando es Extranjero, debe de llevar un numregidtrib
|
||||
ResidenciaFiscal = DomDestino.Pais
|
||||
@@ -324,62 +324,62 @@ Public Class Timbres
|
||||
'' 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 = "",
|
||||
.ObjetoImpuesto = "01"}
|
||||
'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()
|
||||
Else
|
||||
Timbre = Nothing
|
||||
_MsgError.AppendLine("Consultar datos de timbrado")
|
||||
End If
|
||||
Return Timbre
|
||||
End Function
|
||||
|
||||
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 = "",
|
||||
.ObjetoImpuesto = "01"}
|
||||
'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()
|
||||
Else
|
||||
Timbre = Nothing
|
||||
_MsgError.AppendLine("Consultar datos de timbrado")
|
||||
End If
|
||||
Return Timbre
|
||||
End Function
|
||||
|
||||
Public Class MMensajeCartaPorte
|
||||
Public Property TieneError As Boolean
|
||||
Public Property Mensaje As String
|
||||
@@ -633,4 +633,4 @@ Public Class Timbres
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user