Sales Tax Summary Report

Achtung: Diese Seite ist nur noch Teil eines Archivs und wird in Zukunft entfernt.

If you’re located in the European Union and sell products within the whole European Union you need to add tax in the country the customer comes from. To receive the value of the tax in the particular country to inform your finance office you can use the following SQL query directly in your database:

SQL-Abfrage

  1. SELECT SUM(invoice.total) AS totalSum, SUM(invoice.valueAddedTaxIncluded) AS taxSum, (SUM(invoice.total) - SUM(invoice.valueAddedTaxIncluded)) AS net, country.countryCode
  2. FROM kpps1_invoice AS invoice
  3. LEFT JOIN (kpps1_customer AS customer, kpps1_country AS country)
  4. ON (invoice.customerID = customer.customerID AND customer.countryID = country.countryID)
  5. WHERE valueAddedTaxIncluded > 0
  6. AND invoice.time BETWEEN UNIX_TIMESTAMP('2017-01-01 00:00:00') AND UNIX_TIMESTAMP('2017-03-31 23:59:59')
  7. ORDER BY country.countryCode ASC;

You just need to edit the two given dates in line 6. The example above shows the total sum, the tax sum, the net sum and the country code, ordered and summarized by the country code between 2017-01-01 00:00:00 and 2017-03-31 23:59:59.
Über den Autor
Ich bin Webentwickler in Stuttgart und administriere Server seit vielen Jahren. In diesem Blog erstelle ich hauptsächlich Tutorials für andere Webentwickler, Webdesigner und Serveradministratoren.
-------------------------------------------------------------------------------------------------------------------------------------
I’m a web developer in Stuttgart, Germany, and server administrator since many years. This blog mainly contains a tutorial set for other web developer, web designer and server administrators.

1.689 mal gelesen

Kommentare 0

Es wurden keine Einträge gefunden.