sat

package
v0.200.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sat provides specifications from the Mexican SAT (Servicio de Administración Tributaria) tax authority.

Index

Constants

View Source
const (
	StampSignature   cbc.Key = "sat-sig"          // Signature - Sello Digital del SAT (optional)
	StampSerial      cbc.Key = "sat-serial"       // Cert Serial - Número de Certificado SAT
	StampTimestamp   cbc.Key = "sat-timestamp"    // Timestamp - Fecha y hora de certificación del SAT
	StampUUID        cbc.Key = "sat-uuid"         // Folio Fiscal
	StampURL         cbc.Key = "sat-url"          // URL QR Code
	StampProviderRFC cbc.Key = "sat-provider-rfc" // Provider RFC - RFC del Proveedor de Certificación
	StampChain       cbc.Key = "sat-chain"        // Cadena original del complemento de certificación digital del SAT
)

Official SAT codes to include in stamps.

View Source
const (
	KeyFormaPago    cbc.Key = "sat-forma-pago"    // for mapping to c_FormaPago’s codes
	KeyTipoRelacion cbc.Key = "sat-tipo-relacion" // for mapping to c_TipoRelacion’s codes
	KeyImpuesto     cbc.Key = "sat-impuesto"      // for mapping to c_Impuesto’s codes
)

Custom keys used typically in meta or codes information.

View Source
const (
	TaxCategoryRVAT  cbc.Code = "RVAT"  // IVA (Retenido)
	TaxCategoryIEPS  cbc.Code = "IEPS"  // Impuesto Especial sobre Producción y Servicios
	TaxCategoryRIEPS cbc.Code = "RIEPS" // Impuesto Especial sobre Producción y Servicios (Retenido)
	TaxCategoryISR   cbc.Code = "ISR"   // Impuesto Sobre la Renta
)

Local tax categories

View Source
const (
	TaxIdentityCodeGeneric cbc.Code = "XAXX010101000"
	TaxIdentityCodeForeign cbc.Code = "XEXX010101000"
)

Constants used to specific tax identity codes.

View Source
const (
	TaxIdentityTypePerson  cbc.Key = "person"
	TaxIdentityTypeCompany cbc.Key = "company"
)

Tax Identity Type

View Source
const (
	TaxIdentityPatternPerson  = `^([A-ZÑ&]{4})([0-9]{6})([A-Z0-9]{3})$`
	TaxIdentityPatternCompany = `^([A-ZÑ&]{3})([0-9]{6})([A-Z0-9]{3})$`
)

Tax Identity Patterns

View Source
const (
	TaxRateExempt cbc.Key = "exempt"
)

Local tax rates

Variables

View Source
var (
	TaxIdentityRegexpPerson  = regexp.MustCompile(TaxIdentityPatternPerson)
	TaxIdentityRegexpCompany = regexp.MustCompile(TaxIdentityPatternCompany)
)

Tax Identity Regexp

Functions

func CorrectionDefinitions

func CorrectionDefinitions() []*tax.CorrectionDefinition

CorrectionDefinitions provides the array of correction definitions that apply to SAT

func DetermineTaxCodeType

func DetermineTaxCodeType(code cbc.Code) cbc.Key

DetermineTaxCodeType determines the type of tax code or provides an empty key if it looks invalid.

func TaxCategories

func TaxCategories() []*tax.CategoryDef

TaxCategories returns the list of tax categories used in Mexico.

func ValidateTaxCode

func ValidateTaxCode(value interface{}) error

ValidateTaxCode validates a tax code according to the rules defined by the Mexican SAT.

func ValidateTaxIdentity

func ValidateTaxIdentity(tID *tax.Identity) error

ValidateTaxIdentity validates a tax identity for SAT.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL