Skip to content

Commit

Permalink
Add retained and other MX taxes
Browse files Browse the repository at this point in the history
  • Loading branch information
cavalle committed Nov 17, 2023
1 parent a51167c commit 7750c37
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
1 change: 1 addition & 0 deletions regimes/mx/mx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
KeySATFormaPago cbc.Key = "sat-forma-pago" // for mapping to c_FormaPago’s codes
KeySATTipoDeComprobante cbc.Key = "sat-tipo-de-comprobante" // for mapping to c_TipoDeComprobante’s codes
KeySATTipoRelacion cbc.Key = "sat-tipo-relacion" // for mapping to c_TipoRelacion’s codes
KeySATImpuesto cbc.Key = "sat-impuesto" // for mapping to c_Impuesto’s codes
)

// SAT official codes to include in stamps.
Expand Down
86 changes: 85 additions & 1 deletion regimes/mx/tax_categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ import (
"github.com/invopop/gobl/tax"
)

// Tax rates specific to Mexico.
// Local tax categories
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 rates
const (
TaxRateExempt cbc.Key = "exempt"
)

var taxCategories = []*tax.Category{
//
// IVA
//
{
Code: common.TaxCategoryVAT,
Name: i18n.String{
Expand Down Expand Up @@ -71,5 +82,78 @@ var taxCategories = []*tax.Category{
Exempt: true,
},
},
Map: cbc.CodeMap{KeySATImpuesto: "002"},
},

//
// IVA (Retenido)
//
{
Code: TaxCategoryRVAT,
Name: i18n.String{
i18n.EN: "Retained VAT",
i18n.ES: "IVA Retenido",
},
Title: i18n.String{
i18n.EN: "Retained Value Added Tax",
i18n.ES: "Impuesto al Valor Agregado Retenido",
},
Retained: true,
Rates: []*tax.Rate{},
Map: cbc.CodeMap{KeySATImpuesto: "002"},
},

//
// IEPS
//
{
Code: TaxCategoryIEPS,
Name: i18n.String{
i18n.EN: "IEPS",
i18n.ES: "IEPS",
},
Title: i18n.String{
i18n.EN: "Special Tax on Production and Services",
i18n.ES: "Impuesto Especial sobre Producción y Servicios",
},
Retained: false,
Rates: []*tax.Rate{},
Map: cbc.CodeMap{KeySATImpuesto: "003"},
},

//
// IEPS (Retenido)
//
{
Code: TaxCategoryRIEPS,
Name: i18n.String{
i18n.EN: "Retained IEPS",
i18n.ES: "IEPS Retenido",
},
Title: i18n.String{
i18n.EN: "Retained Special Tax on Production and Services",
i18n.ES: "Impuesto Especial sobre Producción y Servicios Retenido",
},
Retained: true,
Rates: []*tax.Rate{},
Map: cbc.CodeMap{KeySATImpuesto: "003"},
},

//
// ISR
//
{
Code: TaxCategoryISR,
Name: i18n.String{
i18n.EN: "ISR",
i18n.ES: "ISR",
},
Title: i18n.String{
i18n.EN: "Income Tax",
i18n.ES: "Impuesto Sobre la Renta",
},
Retained: true,
Rates: []*tax.Rate{},
Map: cbc.CodeMap{KeySATImpuesto: "001"},
},
}

0 comments on commit 7750c37

Please sign in to comment.