Skip to content

Commit

Permalink
Clean up tax categories
Browse files Browse the repository at this point in the history
To handle additional tax categories we need to clean up tax categories
and extensions. We want to handle tax categories for:
standard                      - tax.RateStandard
reduced                       - tax.RateReduced
super reduced                 - tax.RateSuperReduced
taxi                          - tax.RateSpecial + ExtKeyKSeFVATSpecial{taxi}
inside Poland 0%              - tax.RateZero + ExtKeyKSeFVATRegion{domestic}
inside EU 0%                  - tax.RateZero + ExtKeyKSeFVATRegion{EU}
outside EU 0%                 - tax.RateZero + ExtKeyKSeFVATRegion{world}
tax exempt                    - tax.RateExempt
tax not applicable outside EU - TaxRateNotPursuant + ExtKeyKSeFVATRegion{world}
tax not applicable inside EU  - TaxRateNotPursuant + ExtKeyKSeFVATRegion{domestic}
  • Loading branch information
noplisu committed Apr 22, 2024
1 parent 20d04e0 commit 0488855
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 48 deletions.
50 changes: 39 additions & 11 deletions data/regimes/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,42 @@
]
},
{
"key": "pl-ksef-vat-zero",
"key": "pl-ksef-vat-region",
"name": {
"en": "Zero VAT Extensions for KSeF"
"en": "Region VAT Extensions for KSeF"
},
"keys": [
"codes": [
{
"key": "wdt",
"code": "EU",
"name": {
"en": "WDT",
"pl": "WDT"
"en": "EU",
"pl": "EU"
},
"desc": {
"en": "Intra-EU Transactions",
"pl": "Transakcje wewnątrzwspólnotowe"
}
},
{
"key": "domestic",
"code": "domestic",
"name": {
"en": "Domestic",
"pl": "Krajowy"
},
"desc": {
"en": "Domestic trade",
"pl": "Handel wewnątrzkrajowy."
}
},
{
"key": "export",
"code": "non-EU",
"name": {
"en": "Export",
"pl": "Eksport"
"en": "non-EU",
"pl": "Poza UE"
},
"desc": {
"en": "Trading with countries outside the EU",
"pl": "Handel z krajami z poza Unii Europejskiej"
}
}
]
Expand Down Expand Up @@ -428,7 +440,7 @@
}
],
"extensions": [
"pl-ksef-vat-zero"
"pl-ksef-vat-region"
]
},
{
Expand All @@ -445,9 +457,25 @@
"en": "Special Rate",
"pl": "Stawka Specjalna"
},
"values": [
{
"percent": "4.0%"
}
],
"extensions": [
"pl-ksef-vat-special"
]
},
{
"key": "np",
"name": {
"en": "Not pursuant",
"pl": "Niepodlegające opodatkowaniu"
},
"exempt": true,
"extensions": [
"pl-ksef-vat-region"
]
}
]
}
Expand Down
37 changes: 23 additions & 14 deletions regimes/pl/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// Regime extension codes for local electronic formats.
const (
ExtKeyKSeFVATZero = "pl-ksef-vat-zero"
ExtKeyKSeFVATRegion = "pl-ksef-vat-region"
ExtKeyKSeFVATSpecial = "pl-ksef-vat-special"
ExtKeyKSeFEffectiveDate = "pl-ksef-effective-date"
)
Expand All @@ -34,34 +34,43 @@ var extensionKeys = []*cbc.KeyDefinition{
},
},
{
Key: ExtKeyKSeFVATZero,
Key: ExtKeyKSeFVATRegion,
Name: i18n.String{
i18n.EN: "Zero VAT Extensions for KSeF",
i18n.EN: "Region VAT Extensions for KSeF",
},
Keys: []*cbc.KeyDefinition{
Codes: []*cbc.CodeDefinition{
{
Key: "wdt",
Code: "EU",
Name: i18n.String{
i18n.EN: "WDT",
i18n.PL: "WDT",
i18n.EN: "EU",
i18n.PL: "EU",
},
Desc: i18n.String{
i18n.EN: "Intra-EU Transactions",
i18n.PL: "Transakcje wewnątrzwspólnotowe",
},
// TODO: description required
},
{
Key: "domestic",
Code: "domestic",
Name: i18n.String{
i18n.EN: "Domestic",
i18n.PL: "Krajowy",
},
// TODO: description required
Desc: i18n.String{
i18n.EN: "Domestic trade",
i18n.PL: "Handel wewnątrzkrajowy.",
},
},
{
Key: "export",
Code: "non-EU",
Name: i18n.String{
i18n.EN: "Export",
i18n.PL: "Eksport",
i18n.EN: "non-EU",
i18n.PL: "Poza UE",
},
Desc: i18n.String{
i18n.EN: "Trading with countries outside the EU",
i18n.PL: "Handel z krajami z poza Unii Europejskiej",
},
// TODO: description required
},
},
},
Expand Down
40 changes: 17 additions & 23 deletions regimes/pl/tax_categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (

// Tax rates specific to Poland.
const (
TaxRateNotPursuant cbc.Key = "np"
TaxRateNotPursuantArt100 cbc.Key = "np-art100sec1point4"
TaxRateNotPursuant cbc.Key = "np"
)

var taxCategories = []*tax.Category{
Expand Down Expand Up @@ -90,7 +89,7 @@ var taxCategories = []*tax.Category{
},
},
Extensions: []cbc.Key{
ExtKeyKSeFVATZero,
ExtKeyKSeFVATRegion,
},
},
{
Expand All @@ -99,8 +98,7 @@ var taxCategories = []*tax.Category{
i18n.EN: "Exempt",
i18n.PL: "Zwolnione",
},
Exempt: true,
Extensions: []cbc.Key{},
Exempt: true,
},
{
Key: tax.RateSpecial,
Expand All @@ -111,27 +109,23 @@ var taxCategories = []*tax.Category{
Extensions: []cbc.Key{
ExtKeyKSeFVATSpecial,
},
},

/*
* Still working on refactoring these...
{
Key: TaxRateNotPursuant,
Name: i18n.String{
i18n.EN: "Not pursuant, pursuant to art100 section 1 point4",
i18n.PL: "Niepodlegające opodatkowaniu na postawie wyłączeniem art100 sekcja 1 punkt 4",
Values: []*tax.RateValue{
{
Percent: num.MakePercentage(40, 3),
},
Exempt: true,
},
{
Key: TaxRateNotPursuantArt100,
Name: i18n.String{
i18n.EN: "Not pursuant excluding art100 section 1 point4",
i18n.PL: "Niepodlegające opodatkowaniu z wyłączeniem art100 sekcja 1 punkt 4",
},
Exempt: true,
},
{
Key: TaxRateNotPursuant,
Name: i18n.String{
i18n.EN: "Not pursuant",
i18n.PL: "Niepodlegające opodatkowaniu",
},
*/
Exempt: true,
Extensions: []cbc.Key{
ExtKeyKSeFVATRegion,
},
},
},
},
}

0 comments on commit 0488855

Please sign in to comment.