Task 0002128: Clôture comptabilité française

This commit is contained in:
sparkyx 2024-01-07 17:17:10 +01:00
parent 4db377ebba
commit f8bff0171e
14 changed files with 2027 additions and 833 deletions

View file

@ -22,8 +22,7 @@ begin
end if;
return NEW;
end;
$function$
;
$function$;
drop trigger if exists fiche_detail_check_qcode_trg on public.fiche_detail ;
drop function comptaproc.fiche_detail_qcode_upd();
@ -40,3 +39,56 @@ insert into parameter values ('MY_REPORT','N') ON CONFLICT DO NOTHING;
update menu_ref set me_file='payment_method.inc.php' where me_code='CFGPAY';
update menu_ref set me_menu='Principal' where me_code='COMPANY';
update menu_ref set me_menu='Financier' where me_code='MENUFIN';
CREATE OR REPLACE FUNCTION comptaproc.set_tech_user()
RETURNS trigger
AS $function$
declare
/* variable */
noalyss_user text;
begin
new.tech_user := current_setting('noalyss.user_login');
new.tech_date := now();
return NEW;
exception when others then
new.tech_date := now();
new.tech_user := current_user;
return NEW;
end ;
$function$
LANGUAGE plpgsql;
drop table if exists operation_exercice_detail;
drop table if exists operation_exercice;
create table operation_exercice
(
oe_id bigint generated by default as identity primary key,
oe_date date null,
oe_type text not null check (oe_type = 'opening' or oe_type = 'closing'),
oe_text text ,
oe_dossier_id int not null,
oe_exercice int not null,
tech_user text,
tech_date timestamp default now()
);
create table operation_exercice_detail
(
oed_id bigint generated by default as identity primary key,
oe_id bigint references operation_exercice (oe_id) on update cascade on delete cascade not null,
oed_poste account_type ,
oed_qcode text ,
oed_label text,
oed_amount numeric (20,4),
oed_debit bool
);
create trigger trg_set_tech_user before insert or update on operation_exercice for each row execute function comptaproc.set_tech_user();
update menu_ref set me_code='OPCL' , me_menu='Ouvert./Fermeture',me_file='operation_exercice.inc.php',me_description='Opération de cloture ou d''ouverture d''exercice'
,me_description_etendue ='Ecriture d''ouverture ou de fermeture , , reporte les soldes des comptes de l''année passé du poste comptable 0xxx à 5xxxx sur l''année courante ou ferme les comptes de 6 à 7 de l''année '
where me_code='OPEN';