mx

package
v0.50.6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

README

🇲🇽 GOBL Mexico Tax Regime

Mexico uses the CFDI (Comprobante Fiscal Digital por Internet) format for their e-invoicing system.

Public Documentation

Documentation

Overview

Package mx provides the Mexican tax regime.

Index

Constants

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 (
	TaxIdentityCodeForeign cbc.Code = "XEXX010101000"
)

Constants used to specific tax identity codes.

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

Tax rates specific to Mexico.

Variables

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

Tax Identity Regexp

Functions

func Calculate

func Calculate(doc interface{}) error

Calculate performs regime specific calculations.

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 New

func New() *tax.Regime

New provides the tax region definition

func Validate

func Validate(doc interface{}) error

Validate validates a document against the tax regime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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