Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add different tax rates #14

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Add different tax rates #14

wants to merge 13 commits into from

Conversation

noplisu
Copy link
Collaborator

@noplisu noplisu commented Apr 12, 2024

Dependencies

This PR is dependent on invopop/gobl#267

Pull Request summary

In the previous implementation we handled only the basic tax cases, but
to be able to handle international trade we need to handle more complex
cases. Here we add handling of different tax rates for different cases.
The cases we add are:

P_13_4   - TaxiRateNetSale           - special rate for taxi drivers - tax.RateSpecial + ExtKeyKSeFVATSpecial{taxi}
P_13_6_1 - DomesticZeroTaxNetSale    - inside Poland 0%              - tax.RateZero + ExtKeyKSeFVATRegion{domestic}
P_13_6_2 - EUZeroTaxNetSale          - inside EU 0%                  - tax.RateZero + ExtKeyKSeFVATRegion{EU}
P_13_6_3 - ExportNetSale             - outside EU 0%                 - tax.RateZero + ExtKeyKSeFVATRegion{world}
P_13_7   - TaxExemptNetSale          - tax exempt                    - tax.RateExempt
P_13_8   - TaxNAInternationalNetSale - tax not applicable outside EU - pl.TaxRateNotPursuant + ExtKeyKSeFVATRegion{world}
P_13_9   - TaxNAEUNetSale            - tax not applicable inside EU  - pl.TaxRateNotPursuant + ExtKeyKSeFVATRegion{EU}

This still does not cover cases of:
P_13_5   - SpecialProcedureNetSale - VAT-OSS internet EU sales
P_13_10  - EUServiceNetSale        - reverse charge inside Poland
P_13_11  - MarginNetSale           - margin

We also added handling of setting reverse charge addnotation. Acording to current regulations this field should be set if any row is subject to reverse charge.

When do we use the zero tax rate

The regulations indicate situations in which a business entity may apply a 0% VAT rate for sales. It is essential for the seller to be an active VAT taxpayer. The 0% rate does not mean exemption from taxation. Sales made with a 0% VAT rate are still considered taxable. Despite no tax due, sales at a zero VAT rate should be reported in the VAT declaration. The 0% rate can be applied, among others, for the following activities:

  • Intra-Community Supply of Goods (ICS),
  • export of goods,
  • services related to maritime and air transport.

When do we use the tax exempt tax rate

The "ZW" VAT invoice is used by entrepreneurs who are not active VAT taxpayers, are exempt from taxation on goods and services on a subjective basis, or are active VAT taxpayers who provide VAT-exempt services. The "ZW" VAT invoice used by entrepreneurs for the sale of goods or services rendered does not allow for the deduction of VAT on purchases covered by "ZW". Activities exempt from tax include, for example:

  • delivery of own agricultural products,
  • educational services,
  • social assistance services,
  • financial and insurance intermediary services,
  • services related to sports and physical education.

When do we use the tax not applicable tax rate

The entrepreneur who includes the annotation "NP" in the field corresponding to the VAT rate on the invoice indicates that the sale to which the entry refers is not subject to taxation in Poland. The designation "NP" is an abbreviation for the phrase "not subject to." This situation occurs, for example, in the case of entrepreneurs who provide services related to export for foreign customers. Taxation will occur in the buyer's country. The "NP" annotation allows for the settlement of VAT on purchases covered by the entry.

To be able to handle reverse charge we need to set the correct
KSeF addnotation.
invoice.go Outdated Show resolved Hide resolved
In the previous implementation we handled only the basic tax cases, but
to be able to handle international trade we need to handle more complex
cases. Here we add handling of different tax rates for different cases.
The cases we add are:
P_13_4   - TaxiRateNetSale           - special rate for taxi drivers - tax.RateSpecial + ExtKeyKSeFVATSpecial{taxi}
P_13_6_1 - DomesticZeroTaxNetSale    - inside Poland 0%              - tax.RateZero + ExtKeyKSeFVATRegion{domestic}
P_13_6_2 - EUZeroTaxNetSale          - inside EU 0%                  - tax.RateZero + ExtKeyKSeFVATRegion{EU}
P_13_6_3 - ExportNetSale             - outside EU 0%                 - tax.RateZero + ExtKeyKSeFVATRegion{world}
P_13_7   - TaxExemptNetSale          - tax exempt                    - tax.RateExempt
P_13_8   - TaxNAInternationalNetSale - tax not applicable outside EU - pl.TaxRateNotPursuant + ExtKeyKSeFVATRegion{world}
P_13_9   - TaxNAEUNetSale            - tax not applicable inside EU  - pl.TaxRateNotPursuant + ExtKeyKSeFVATRegion{EU}

This still does not cover cases of:
P_13_5   - SpecialProcedureNetSale - VAT-OSS internet EU sales
P_13_10  - EUServiceNetSale        - reverse charge inside Poland
P_13_11  - MarginNetSale           - margin
When saving the data we were using the invoice number as the filename.
We did not sanitize the filename which can cause errors in some cases
when the file uses slashes or dots in the filename. We add a method
to sanitize the filename before creating the file.
In some tax rate cases we want to set the percentage value of the tax
in other cases we want to have a string saying that the line is exempt.

Here we add methods to decide what value should the TaxRate have.
When creating a credit note we want to invert the values on the
invoice.
In KSeF depending on customer location you need to fill in different
fields. For domestic customers we need to fill in the NIP number.
For customers inside the EU we need to fill in the UECode and UEVatNumber.
For non EU customers we need to fill in CountryCode and IDNumber and in
cases when there is no tax id number present we need to set the NoID flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants