numerus/verify/tax.sql
jordi fita mas 11d51df7fa Introduce the concept of tax class
We want to show the percentage of the tax as columns in the invoice,
but until now it was not possible to have a single VAT column when
products have different VAT (e.g., 4 % and 10 %), because, as far
as the application is concerned, these where ”different taxes”.  We
also think it would be hard later on to compute the tax due to the
government.

So, tax classes is just a taxonomy to be able to have different names
and rates for the same type of tax, mostly VAT and retention in our
case.
2023-02-28 12:02:27 +01:00

17 lines
353 B
PL/PgSQL

-- Verify numerus:tax on pg
begin;
select tax_id
, company_id
, tax_class_id
, name
, rate
from numerus.tax
where false;
select 1 / count(*) from pg_class where oid = 'numerus.tax'::regclass and relrowsecurity;
select 1 / count(*) from pg_policy where polname = 'company_policy' and polrelid = 'numerus.tax'::regclass;
rollback;