Task #0001762: TVA France , add the possibility to compute VAT at
the date of operation , payment. PRINTTVA : Add feature summary of VAT depending of operation date, payment date or VAT setting
This commit is contained in:
parent
ef108c2fc8
commit
6b96cb0a44
23 changed files with 1435 additions and 661 deletions
36
include/sql/patch/upgrade138.sql
Normal file
36
include/sql/patch/upgrade138.sql
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
begin;
|
||||
ALTER TABLE public.tva_rate ADD tva_payment_sale char(1) NULL DEFAULT 'O';
|
||||
update public.tva_rate set tva_payment_sale='O';
|
||||
ALTER TABLE public.tva_rate ADD CONSTRAINT tva_rate_sale_check CHECK (tva_payment in ('O','P'));
|
||||
comment on column public.tva_rate.tva_payment_sale is 'Check if the VAT on Sale must be declared when at the date of payment (P) or the date of operation (O)';
|
||||
|
||||
|
||||
ALTER TABLE public.tva_rate ADD tva_payment_purchase char(1) NULL DEFAULT 'O';
|
||||
update public.tva_rate set tva_payment_purchase='O';
|
||||
ALTER TABLE public.tva_rate ADD CONSTRAINT tva_rate_purchase_check CHECK (tva_payment in ('O','P'));
|
||||
comment on column public.tva_rate.tva_payment_purchase is 'Check if the VAT on Purchase must be declared when at the date of payment (P) or the date of operation (O)';
|
||||
|
||||
|
||||
drop VIEW public.v_tva_rate;
|
||||
|
||||
CREATE OR REPLACE VIEW public.v_tva_rate
|
||||
AS SELECT tva_rate.tva_id,
|
||||
tva_rate.tva_rate,
|
||||
tva_rate.tva_label,
|
||||
tva_rate.tva_comment,
|
||||
split_part(tva_rate.tva_poste, ','::text, 1) AS tva_purchase,
|
||||
split_part(tva_rate.tva_poste, ','::text, 2) AS tva_sale,
|
||||
tva_rate.tva_both_side,
|
||||
tva_payment_purchase,
|
||||
tva_payment_sale
|
||||
FROM tva_rate;
|
||||
|
||||
COMMENT ON VIEW public.v_tva_rate IS 'Show this table to be easily used by Tva_Rate_MTable';
|
||||
COMMENT ON COLUMN public.v_tva_rate.tva_purchase IS ' VAT used for purchase';
|
||||
COMMENT ON COLUMN public.v_tva_rate.tva_sale IS ' VAT used for sale';
|
||||
COMMENT ON COLUMN public.v_tva_rate.tva_both_side IS 'if 1 , VAT avoided ';
|
||||
comment on column public.v_tva_rate.tva_payment_purchase is 'Check if the VAT on Purchase must be declared when at the date of payment (P) or the date of operation (O)';
|
||||
comment on column public.v_tva_rate.tva_payment_sale is 'Check if the VAT on Sale must be declared when at the date of payment (P) or the date of operation (O)';
|
||||
|
||||
insert into version (val,v_description) values (139,'Add VAT exigibility');
|
||||
commit ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue