Documentation ¶
Overview ¶
Package addendas adds additional functionality for "Addendas" to the CFDI documents.
Index ¶
Constants ¶
const ( MabeVersion = "1.0" MabeNamespace = "https://recepcionfe.mabempresa.com/cfd/addenda/v1" MabeSchemaLocation = "https://recepcionfe.mabempresa.com/cfd/addenda/v1/mabev1.xsd" MabeNotApplicable = "NA" )
Mabe schema constants
const ( MabeTipoDocumentoFactura = "FACTURA" MabeTipoDocumentoNotaCredito = "NOTA CREDITO" MabeTipoDocumentoNotaCargo = "NOTA CARGO" )
TipoDocumento valid values
const ( MabeKeyIdentityPurchaseOrder = "mx-mabe-purchase-order" MabeKeyIdentityProviderCode = "mx-mabe-provider-code" MabeKeyIdentityRef1 = "mx-mabe-reference1" MabeKeyIdentityRef2 = "mx-mabe-reference2" MabeKeyIdentityDeliveryPlant = "mx-mabe-delivery-plant" MabeKeyIdentityArticleCode = "mx-mabe-article-code" MabeKeyIdentityUnit = "mx-mabe-unit" )
Mabe specific identity codes.
Variables ¶
var MabeTipoDocumentoMap = map[cbc.Key]string{ bill.InvoiceTypeStandard: MabeTipoDocumentoFactura, bill.InvoiceTypeCreditNote: MabeTipoDocumentoNotaCredito, bill.InvoiceTypeDebitNote: MabeTipoDocumentoNotaCargo, }
MabeTipoDocumentoMap maps GOBL invoice types to Mabe's TipoDocumento
Functions ¶
Types ¶
type MabeDescuentos ¶
type MabeDescuentos struct { Tipo string `xml:"tipo,attr"` Descripcion string `xml:"descripcion,attr"` //nolint:misspell Importe string `xml:"importe,attr"` }
MabeDescuentos carries the data about an invoice's discount
type MabeDetalle ¶
type MabeDetalle struct { NoLineaArticulo int `xml:"noLineaArticulo,attr"` CodigoArticulo string `xml:"codigoArticulo,attr"` Descripcion string `xml:"descripcion,attr"` //nolint:misspell Unidad string `xml:"unidad,attr"` Cantidad string `xml:"cantidad,attr"` PrecioSinIva string `xml:"precioSinIva,attr"` ImporteSinIva string `xml:"importeSinIva,attr"` PrecioConIva string `xml:"precioConIva,attr,omitempty"` // Not implemented yet ImporteConIva string `xml:"importeConIva,attr,omitempty"` // Not implemented yet }
MabeDetalle carries the data about one invoice's line
type MabeDetalles ¶
type MabeDetalles struct {
Detalle []*MabeDetalle `xml:"mabe:Detalle"`
}
MabeDetalles carries the data about an invoice's lines
type MabeEntrega ¶
type MabeEntrega struct { PlantaEntrega string `xml:"plantaEntrega,attr"` Calle string `xml:"calle,attr,omitempty"` NoExterior string `xml:"noExterior,attr,omitempty"` NoInterior string `xml:"noInterior,attr,omitempty"` CodigoPostal string `xml:"codigoPostal,attr,omitempty"` }
MabeEntrega carries the data about the invoice's delivery
type MabeFactura ¶
type MabeFactura struct { XMLName xml.Name `xml:"mabe:Factura"` Namespace string `xml:"xmlns:mabe,attr"` SchemaLocation string `xml:"xsi:schemaLocation,attr"` Version string `xml:"version,attr"` TipoDocumento string `xml:"tipoDocumento,attr"` Folio string `xml:"folio,attr"` Fecha string `xml:"fecha,attr"` OrdenCompra string `xml:"ordenCompra,attr"` Referencia1 string `xml:"referencia1,attr"` Referencia2 string `xml:"referencia2,attr,omitempty"` Moneda *MabeMoneda `xml:"mabe:Moneda"` Proveedor *MabeProveedor `xml:"mabe:Proveedor"` Entrega *MabeEntrega `xml:"mabe:Entrega"` Detalles *MabeDetalles `xml:"mabe:Detalles"` Descuentos *MabeDescuentos `xml:"mabe:Descuentos,omitempty"` Subtotal *MabeImporte `xml:"mabe:Subtotal"` Traslados *MabeTraslados `xml:"mabe:Traslados"` Retenciones *MabeRetenciones `xml:"mabe:Retenciones"` Total *MabeImporte `xml:"mabe:Total"` }
MabeFactura is the root element of the Mabe addendum
type MabeImporte ¶
type MabeImporte struct {
Importe string `xml:"importe,attr"`
}
MabeImporte carries the data about an invoice's total
type MabeImpuesto ¶
type MabeImpuesto struct { Tipo string `xml:"tipo,attr"` Tasa string `xml:"tasa,attr"` Importe string `xml:"importe,attr"` }
MabeImpuesto carries the data about an invoice's tax
type MabeMoneda ¶
type MabeMoneda struct { TipoMoneda string `xml:"tipoMoneda,attr"` TipoCambio string `xml:"tipoCambio,attr,omitempty"` // Not implemented yet ImporteConLetra string `xml:"importeConLetra,attr,omitempty"` // Not implemented yet }
MabeMoneda carries the data about the invoice's currency
type MabeProveedor ¶
type MabeProveedor struct {
Codigo string `xml:"codigo,attr"`
}
MabeProveedor carries the data about the invoice's supplier
type MabeRetenciones ¶
type MabeRetenciones struct {
Retencion []*MabeImpuesto `xml:"mabe:Retencion"`
}
MabeRetenciones carries the data about an invoice's retained taxes
type MabeTraslados ¶
type MabeTraslados struct {
Traslado []*MabeImpuesto `xml:"mabe:Traslado"`
}
MabeTraslados carries the data about an invoice's taxes (expect retained ones)