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 17, 2024
1 parent 20d04e0 commit be63c51
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.
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: "Inter european trade",
i18n.PL: "Handel wewnątrzwspólnotowy.",
},
// 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: "World",
i18n.PL: "Świat",
},
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 be63c51

Please sign in to comment.