-
Notifications
You must be signed in to change notification settings - Fork 1
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
noplisu
wants to merge
13
commits into
main
Choose a base branch
from
gl-add-different-tax-rates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To be able to handle reverse charge we need to set the correct KSeF addnotation.
torrocus
reviewed
Apr 16, 2024
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.
noplisu
force-pushed
the
gl-add-different-tax-rates
branch
from
April 17, 2024 15:11
dd8ff2b
to
f12c992
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
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:
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.