-- mejoras en timbrado 4.0 y complementos de carta porte
This commit is contained in:
@@ -3749,7 +3749,7 @@ Public Class ClsGenerales
|
||||
End Function
|
||||
|
||||
Public Function UpdateTimbreTimbrado(CveTimbre As Integer, FolioFiscal As String, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
CvePAC As Integer) As Boolean
|
||||
CvePAC As Integer, CFDIVersion As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_TimbreTimbrado")
|
||||
|
||||
@@ -3759,6 +3759,7 @@ Public Class ClsGenerales
|
||||
.Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
|
||||
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||
.Add("@CvePAC", SqlDbType.Int).Value = CvePAC
|
||||
.Add("@CDFIVersion", SqlDbType.VarChar).Value = CFDIVersion
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
@@ -2832,7 +2832,7 @@ Public Class Timbrado
|
||||
Case "T"
|
||||
|
||||
Dim objGrales As New ClsGenerales
|
||||
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC) Then
|
||||
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "3.3") Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
@@ -5658,7 +5658,7 @@ Public Class Timbrado
|
||||
Case "T"
|
||||
|
||||
Dim objGrales As New ClsGenerales
|
||||
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC) Then
|
||||
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "4.0") Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
|
||||
@@ -41,8 +41,10 @@ Public Class Timbres
|
||||
|
||||
|
||||
Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer)
|
||||
ObjFactura = New Modelos.Factura
|
||||
ObjFactura = New Modelos.Factura
|
||||
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
|
||||
@@ -84,8 +86,10 @@ Public Class Timbres
|
||||
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 = "P01"
|
||||
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
|
||||
@@ -124,7 +128,7 @@ Public Class Timbres
|
||||
|
||||
Timbre.Receptor.RFC = drT("EmpresaRFC").ToString
|
||||
Timbre.Receptor.Nombre = drT("EmpresaNombre").ToString
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = drT("DirDesCP").ToString
|
||||
Timbre.Receptor.DomicilioFiscalReceptor = drT("DomicilioFiscalReceptor").ToString
|
||||
Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
|
||||
|
||||
CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
|
||||
@@ -216,8 +220,8 @@ Public Class Timbres
|
||||
End If
|
||||
|
||||
Dim Ubica As New CFDICartaPorteUbicacion
|
||||
Ubica.TipoEstacion = ""
|
||||
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString,
|
||||
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}
|
||||
@@ -230,9 +234,9 @@ Public Class Timbres
|
||||
.NumRegIdTrib = NumRegIdTrib}
|
||||
|
||||
CartaPorte.Ubicaciones.Add(Ubica)
|
||||
CartaPorte.FiguraTransporte.ClaveTransporte = "01"
|
||||
CartaPorte.FiguraTransporte.ClaveTransporte = "01"
|
||||
|
||||
Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString,
|
||||
Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString,
|
||||
.NumeroExterior = drT("FiguraNumeroExterior").ToString,
|
||||
.NumeroInterior = drT("FiguraNumeroInterior").ToString,
|
||||
.Colonia = drT("FiguraClaveSATColonia").ToString,
|
||||
@@ -242,7 +246,7 @@ Public Class Timbres
|
||||
|
||||
|
||||
|
||||
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {
|
||||
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {
|
||||
.RFCFigura = drT("FiguraRFC").ToString,
|
||||
.NombreFigura = drT("FiguraChofer").ToString,
|
||||
.NumLicencia = drT("FiguraLicencia").ToString,
|
||||
@@ -251,8 +255,8 @@ Public Class Timbres
|
||||
.Domicilio = DomicilioOperador})
|
||||
|
||||
|
||||
'concepto único
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
|
||||
'concepto único
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
|
||||
.Descripcion = "Traslado",
|
||||
.ValorUnitario = 0,
|
||||
.Importe = 0,
|
||||
@@ -261,22 +265,23 @@ Public Class Timbres
|
||||
.ClaveUnidad = "E48",
|
||||
.ClaveProdServ = "78101802",
|
||||
.Noidentificacion = "",
|
||||
.CuentaPredial = ""}
|
||||
.CuentaPredial = "",
|
||||
.ObjetoImpuesto = "01"}
|
||||
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
|
||||
If drr("PS").ToString.Length = 1 Then
|
||||
tPS = drr("Obs").ToString
|
||||
If drr("PS").ToString.Length = 1 Then
|
||||
tPS = drr("Obs").ToString
|
||||
Else
|
||||
If drr("PS").ToString.Length = 0 Then
|
||||
tPS = ""
|
||||
Else
|
||||
If drr("PS").ToString.Length = 0 Then
|
||||
tPS = ""
|
||||
Else
|
||||
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||
End If
|
||||
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||
End If
|
||||
Dim conceptoCarta As New CFDICartaPorteMercancia With {
|
||||
End If
|
||||
Dim conceptoCarta As New CFDICartaPorteMercancia With {
|
||||
.BienesTransp = drr("SATClaveProdServ").ToString,
|
||||
.ClaveSTCC = "", 'para metodo ferroviario
|
||||
.Cantidad = drr("Cantidad").ToString.ToDecimal,
|
||||
@@ -290,29 +295,29 @@ Public Class Timbres
|
||||
.Embalaje = drr("ClaveEmbalaje").ToString,
|
||||
.DescripEmbalaje = drr("Embalaje").ToString,
|
||||
.ValorMercancia = drr("PU").ToString.ToDecimal,
|
||||
.Moneda = "MXN", 'temporal
|
||||
.Moneda = IIf(drr("PU").ToString.ToDecimal > 0, "MXN", ""), 'temporal
|
||||
.FraccionArrancelaria = "",
|
||||
.UUIDComercioExt = ""
|
||||
}
|
||||
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
|
||||
conceptoCarta.DetalleMercancia = DetalleMercancia
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
|
||||
conceptoCarta.DetalleMercancia = DetalleMercancia
|
||||
|
||||
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
|
||||
conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta)
|
||||
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)
|
||||
totSubTotal = totSubTotal - concepto.Importe
|
||||
CartaPorte.Mercancias.Mercancias.Add(conceptoCarta)
|
||||
|
||||
i += 1
|
||||
Next
|
||||
Timbre.Complementos.CartaPorte = CartaPorte
|
||||
i += 1
|
||||
Next
|
||||
Timbre.Complementos.CartaPorte = CartaPorte
|
||||
|
||||
Else
|
||||
'' T R A S L A D O S
|
||||
Else
|
||||
'' T R A S L A D O S
|
||||
|
||||
'DETALLES
|
||||
If Obj.DtDetalle IsNot Nothing Then
|
||||
'DETALLES
|
||||
If Obj.DtDetalle IsNot Nothing Then
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
|
||||
If drr("PS").ToString.Length = 1 Then
|
||||
|
||||
BIN
Bin/GoCfdi.dll
BIN
Bin/GoCfdi.dll
Binary file not shown.
@@ -1692,12 +1692,17 @@ Partial Class PopUpVerFactura
|
||||
Dim ImagenCBB As New System.IO.FileInfo(RutaCBB)
|
||||
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
Dim Version = ValorXML(nodo, "version")
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
If Version = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
@@ -1737,7 +1742,6 @@ Partial Class PopUpVerFactura
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces)
|
||||
|
||||
Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces)
|
||||
|
||||
@@ -1268,8 +1268,6 @@ Partial Class Clientes
|
||||
|
||||
CargaCombosComercioExterior()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub CargaSubProyectoss()
|
||||
|
||||
@@ -2480,18 +2478,37 @@ Partial Class Clientes
|
||||
|
||||
End If
|
||||
|
||||
'CargaSucursal()
|
||||
'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then
|
||||
' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
|
||||
|
||||
'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa))
|
||||
'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then
|
||||
' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
If TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscal.SelectedValue <> "11" Then
|
||||
|
||||
Alert("El Regimen fiscal del cliente debe ser <b>'616 - Sin obligaciones fiscales'</b> cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
If TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDI.SelectedValue <> "23" Then
|
||||
|
||||
Alert("El Regimen fiscal del cliente debe ser <b>'S01 - Sin efectos fiscales'</b> cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'CargaSucursal()
|
||||
'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then
|
||||
' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa))
|
||||
'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then
|
||||
' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'End If
|
||||
Dim ObjClientes As New ClsClientes()
|
||||
Dim objDoc As New ClsEdocumentacion(ObjClientes.IniciaTransacSQL())
|
||||
Dim MsgCuentaContable As String = ""
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
Reference in New Issue
Block a user