Merge branch 'master' of http://192.168.10.111:8383/SIG
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
|
||||
|
||||
@@ -8802,9 +8802,17 @@ Public Class ClsPaginas
|
||||
#End Region
|
||||
|
||||
#Region "PDF PAGOS"
|
||||
|
||||
Private Function ValorXML(n As XmlNode, Campo As String, Optional Retorno As String = "") As String
|
||||
Dim o As XmlNode = n.Attributes.Cast(Of XmlAttribute)().SingleOrDefault(Function(a) String.Compare(a.Name, Campo, True) = 0)
|
||||
If o Is Nothing Then
|
||||
Return Retorno
|
||||
Else
|
||||
Return o.Value
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Sub PDFReciboDePagos(CveVenta As Integer, CveIE As Integer, CveComplementoPago As Integer, Optional imprimir As Boolean = True)
|
||||
|
||||
|
||||
Dim ObjBancos As New ClsBancos
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Dim params As New List(Of ReportParameter)
|
||||
@@ -8855,6 +8863,7 @@ Public Class ClsPaginas
|
||||
DTConceptosPagoRelacionado.Columns.Add("MetodoDePagoDR", GetType(String))
|
||||
DTConceptosPagoRelacionado.Columns.Add("MonedaDR", GetType(String))
|
||||
DTConceptosPagoRelacionado.Columns.Add("TipoCambioDR", GetType(String))
|
||||
DTConceptosPagoRelacionado.Columns.Add("ObjetoImpDR", GetType(String))
|
||||
|
||||
|
||||
If ObjBancos.GetComplementoPagos(CveComplementoPago, CveIE, CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
@@ -8901,13 +8910,29 @@ Public Class ClsPaginas
|
||||
|
||||
Dim ImagenCBB As String = $"file://{Ruta}CBB\{Serie}-{Folio}.jpg"
|
||||
|
||||
|
||||
If File.Exists(PathXML) Then
|
||||
Dim XmlDoc As New System.Xml.XmlDocument
|
||||
XmlDoc.Load(PathXML)
|
||||
Dim Version = ValorXML(XmlDoc.DocumentElement, "version")
|
||||
Dim namespaces As New XmlNamespaceManager(XmlDoc.NameTable)
|
||||
Dim Prefijo As String = If(XmlDoc.DocumentElement.Prefix = "", "cfd", XmlDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = ""
|
||||
|
||||
Dim validaElemento = XmlDoc.DocumentElement("cfdi:Complemento")
|
||||
Dim validaElementoPago = XmlDoc.DocumentElement("cfdi:Conceptos")
|
||||
|
||||
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
|
||||
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
|
||||
namespaces.AddNamespace("pago20", "http://www.sat.gob.mx/Pagos20")
|
||||
|
||||
'Datos Fiscales
|
||||
If Not IsNothing(validaElemento) Then
|
||||
For i As Integer = 0 To XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes.Count - 1
|
||||
@@ -8924,8 +8949,18 @@ Public Class ClsPaginas
|
||||
'Pago
|
||||
If Not IsNothing(validaElemento) Then
|
||||
Dim PagosChild = XmlDoc.DocumentElement("cfdi:Complemento").ChildNodes.Cast(Of XmlNode).Where(Function(a) a.LocalName.Equals("Pagos", StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault()
|
||||
Dim nodePagos As XmlNodeList
|
||||
If Version = "3.3" Then
|
||||
nodePagos = XmlDoc.SelectNodes(String.Format("//{0}:Comprobante/{0}:Complemento/pago10:Pago", Prefijo), namespaces)
|
||||
Else
|
||||
nodePagos = XmlDoc.SelectNodes(String.Format("//{0}:Comprobante/{0}:Complemento/pago20:Pagos/pago20:Pago", Prefijo), namespaces)
|
||||
End If
|
||||
|
||||
For Each Pagos As XmlNode In nodePagos
|
||||
If Version = "4.0" AndAlso Pagos.Name = "pago20:Totales" Then
|
||||
Dim a As String = "a"
|
||||
Else
|
||||
|
||||
For Each Pagos As XmlNode In PagosChild.ChildNodes
|
||||
Dim Dr As DataRow = DTConceptosPago.NewRow
|
||||
|
||||
If Not Pagos.Attributes("CtaOrdenante") Is Nothing Then Dr("CtaOrdenante") = Pagos.Attributes("CtaOrdenante").Value Else Dr("CtaOrdenante") = ""
|
||||
@@ -8948,7 +8983,7 @@ Public Class ClsPaginas
|
||||
|
||||
DTConceptosPago.Rows.Add(Dr)
|
||||
|
||||
For Each Relacionado As XmlNode In Pagos.ChildNodes
|
||||
For Each Relacionado As XmlNode In Pagos.SelectNodes("//pago20:DoctoRelacionado", namespaces)
|
||||
Dim DrRelacionado As DataRow = DTConceptosPagoRelacionado.NewRow
|
||||
|
||||
If Not Relacionado.Attributes("Folio") Is Nothing Then DrRelacionado("Folio") = Relacionado.Attributes("Folio").Value Else DrRelacionado("Folio") = ""
|
||||
@@ -8959,11 +8994,15 @@ Public Class ClsPaginas
|
||||
DrRelacionado("ImpPagado") = Relacionado.Attributes("ImpPagado").Value
|
||||
DrRelacionado("ImpSaldoAnt") = Relacionado.Attributes("ImpSaldoAnt").Value
|
||||
DrRelacionado("NumParcialidad") = Relacionado.Attributes("NumParcialidad").Value
|
||||
DrRelacionado("MetodoDePagoDR") = Relacionado.Attributes("MetodoDePagoDR").Value
|
||||
If Version = "3.3" Then DrRelacionado("MetodoDePagoDR") = Relacionado.Attributes("MetodoDePagoDR").Value
|
||||
If Version = "4.0" Then DrRelacionado("ObjetoImpDR") = Relacionado.Attributes("ObjetoImpDR").Value
|
||||
|
||||
DrRelacionado("MonedaDR") = Relacionado.Attributes("MonedaDR").Value
|
||||
|
||||
DTConceptosPagoRelacionado.Rows.Add(DrRelacionado)
|
||||
Next
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
@@ -4854,14 +4854,14 @@ Public Class ClsVentas
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, CveClasificacion As Integer, CveClasificacionSup As Integer, CveEmpresa As Integer) As Boolean
|
||||
Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Decimal, MetaImporte As Decimal, CveClasificacion As Integer, CveClasificacionSup As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_MetasVendedoresAdd", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@MesAño", SqlDbType.DateTime).Value = MesAño
|
||||
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||
.Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad
|
||||
.Add("@MetaCantidad", SqlDbType.SmallMoney).Value = MetaCantidad
|
||||
.Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
.Add("@CveClasificacionSup", SqlDbType.Int).Value = CveClasificacionSup
|
||||
|
||||
@@ -3891,7 +3891,7 @@ Namespace Modelos
|
||||
Dim PU As Decimal = RowGarantia("Importe").ToString().ToDecimal() ' / RowGarantia("Cantidad").ToString().ToDouble()
|
||||
Dim Serie As String = RowGarantia("Comprobante").ToString
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=RowGarantia("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoGarantia, RowGarantia("Cantidad").ToString().ToDouble(), CveUM, CvePS, PU, Serie:=Serie, CveVentaDetalle:=IIf(RowGarantia("MismoCvePS").ToString = "1", RowGarantia("CveVentaDetalle"), -1).ToString.ToEntero) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -43,6 +43,8 @@ Public Class Timbres
|
||||
Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer)
|
||||
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
|
||||
@@ -85,7 +87,9 @@ Public Class Timbres
|
||||
Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
Timbre.Comprobante.Moneda = "XXX"
|
||||
Timbre.Comprobante.TipoCambio = "" ' CONDICIÓN SI LA MONEDA ES 'XXX'
|
||||
Timbre.Receptor.UsoCFDI = "P01"
|
||||
|
||||
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
|
||||
@@ -261,7 +265,8 @@ Public Class Timbres
|
||||
.ClaveUnidad = "E48",
|
||||
.ClaveProdServ = "78101802",
|
||||
.Noidentificacion = "",
|
||||
.CuentaPredial = ""}
|
||||
.CuentaPredial = "",
|
||||
.ObjetoImpuesto = "01"}
|
||||
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
|
||||
@@ -290,7 +295,7 @@ 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 = ""
|
||||
}
|
||||
@@ -337,7 +342,8 @@ Public Class Timbres
|
||||
.ClaveUnidad = drr("SATClaveUM").ToString,
|
||||
.ClaveProdServ = drr("SATClaveProdServ").ToString,
|
||||
.Noidentificacion = drr("Noidentificacion").ToString,
|
||||
.CuentaPredial = ""}
|
||||
.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
|
||||
|
||||
@@ -1370,7 +1370,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
IdCtaContable = IdCuenta
|
||||
End If
|
||||
|
||||
Dim Importe42 As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
Dim Importe42 As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal + gvr.FCTextBox("TxtComision").Text.ToDecimal
|
||||
ImporteMovimiento = Importe42
|
||||
importeMX = If(CveMoneda = 2, If(DivTC.Visible, Importe42 / TxtTC.Text.ToDecimal * TipoCambioPago, Importe42 * TipoCambioPago), Importe42)
|
||||
TipoCambioGeneral = TipoCambioPago
|
||||
|
||||
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()
|
||||
|
||||
@@ -2478,6 +2476,25 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
|
||||
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user