COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
COMMENT ON FUNCTION correct_sequence(p_sequence text, p_col text, p_table text) IS ' Often the primary key is a sequence number and sometimes the value of the sequence is not synchronized with the primary key ( p_sequence : sequence name, p_col : col of the pk,p_table : concerned table';
COMMENT ON FUNCTION format_account(p_account public.account_type) IS 'format the accounting :
- upper case
- remove space and special char.
';
COMMENT ON FUNCTION html_quote(p_string text) IS 'remove harmfull HTML char';
COMMENT ON TABLE action IS 'The different privileges';
COMMENT ON COLUMN action.ac_code IS 'this code will be used in the code with the function User::check_action ';
COMMENT ON TABLE action_detail IS 'Detail of action_gestion, see class Action_Detail';
COMMENT ON COLUMN action_detail.f_id IS 'the concerned	card';
COMMENT ON COLUMN action_detail.ad_text IS ' Description ';
COMMENT ON COLUMN action_detail.ad_pu IS ' price per unit ';
COMMENT ON COLUMN action_detail.ad_quant IS 'quantity ';
COMMENT ON COLUMN action_detail.ad_tva_id IS ' tva_id ';
COMMENT ON COLUMN action_detail.ad_tva_amount IS ' tva_amount ';
COMMENT ON COLUMN action_detail.ad_total_amount IS ' total amount';
COMMENT ON TABLE action_gestion IS 'Contains the details for the follow-up of customer, supplier, administration';
COMMENT ON COLUMN action_gestion.ag_type IS ' type of action: see document_type ';
COMMENT ON COLUMN action_gestion.f_id_dest IS ' third party ';
COMMENT ON COLUMN action_gestion.ag_title IS ' title ';
COMMENT ON COLUMN action_gestion.ag_timestamp IS ' ';
COMMENT ON COLUMN action_gestion.ag_ref IS 'its reference ';
COMMENT ON COLUMN action_gestion.ag_priority IS 'Low, medium, important ';
COMMENT ON COLUMN action_gestion.ag_dest IS ' is the profile which has to take care of this action ';
COMMENT ON COLUMN action_gestion.ag_owner IS ' is the owner of this action ';
COMMENT ON COLUMN action_gestion.ag_contact IS ' contact of the third part ';
COMMENT ON COLUMN action_gestion.ag_state IS 'state of the action same as document_state ';
COMMENT ON COLUMN action_gestion_comment.agc_id IS 'PK';
COMMENT ON COLUMN action_gestion_comment.ag_id IS 'FK to action_gestion';
COMMENT ON COLUMN action_gestion_comment.agc_comment IS 'comment';
COMMENT ON COLUMN action_gestion_comment.tech_user IS 'user_login';
COMMENT ON COLUMN action_gestion_operation.ago_id IS 'pk';
COMMENT ON COLUMN action_gestion_operation.ag_id IS 'fk to action_gestion';
COMMENT ON COLUMN action_gestion_operation.jr_id IS 'fk to jrn';
COMMENT ON COLUMN action_gestion_related.aga_id IS 'pk';
COMMENT ON COLUMN action_gestion_related.aga_least IS 'fk to action_gestion, smallest ag_id';
COMMENT ON COLUMN action_gestion_related.aga_greatest IS 'fk to action_gestion greatest ag_id';
COMMENT ON COLUMN action_gestion_related.aga_type IS 'Type de liens';
COMMENT ON TABLE action_person IS 'Person involved in the action';
COMMENT ON COLUMN action_person.ap_id IS 'pk';
COMMENT ON COLUMN action_person.ag_id IS 'fk to fiche';
COMMENT ON TABLE attr_def IS 'The available attributs for the cards';
COMMENT ON TABLE attr_min IS 'The value of  attributs for the cards';
COMMENT ON TABLE bilan IS 'contains the template and the data for generating different documents  ';
COMMENT ON COLUMN bilan.b_id IS 'primary key';
COMMENT ON COLUMN bilan.b_name IS 'Name of the document';
COMMENT ON COLUMN bilan.b_file_template IS 'path of the template (document/...)';
COMMENT ON COLUMN bilan.b_file_form IS 'path of the file with forms';
COMMENT ON COLUMN bilan.b_type IS 'type = ODS, RTF...';
COMMENT ON TABLE bookmark IS 'Bookmark of the connected user';
COMMENT ON TABLE centralized IS 'The centralized journal';
COMMENT ON TABLE document IS 'This table contains all the documents : summary and lob files';
COMMENT ON TABLE document_modele IS ' contains all the template for the  documents';
COMMENT ON SEQUENCE document_seq IS 'Sequence for the sequence bound to the document modele';
COMMENT ON TABLE document_state IS 'State of the document';
COMMENT ON TABLE document_type IS 'Type of document : meeting, invoice,...';
COMMENT ON COLUMN document_type.dt_prefix IS 'Prefix for ag_ref';
COMMENT ON TABLE extension IS 'Content the needed information for the extension';
COMMENT ON COLUMN extension.ex_id IS 'Primary key';
COMMENT ON COLUMN extension.ex_name IS 'code of the extension ';
COMMENT ON COLUMN extension.ex_code IS 'code of the extension ';
COMMENT ON COLUMN extension.ex_desc IS 'Description of the extension ';
COMMENT ON COLUMN extension.ex_file IS 'path to the extension to include';
COMMENT ON COLUMN extension.ex_enable IS 'Y : enabled N : disabled ';
COMMENT ON TABLE fiche IS 'Cards';
COMMENT ON TABLE fiche_def IS 'Cards definition';
COMMENT ON TABLE fiche_def_ref IS 'Family Cards definition';
COMMENT ON TABLE fiche_detail IS 'join between the card and the attribut definition';
COMMENT ON TABLE forecast IS 'contains the name of the forecast';
COMMENT ON COLUMN forecast_cat.fc_id IS 'primary key';
COMMENT ON COLUMN forecast_cat.fc_desc IS 'text of the category';
COMMENT ON COLUMN forecast_cat.f_id IS 'Foreign key, it is the parent from the table forecast';
COMMENT ON COLUMN forecast_cat.fc_order IS 'Order of the category, used when displaid';
COMMENT ON COLUMN forecast_item.fi_id IS 'Primary key';
COMMENT ON COLUMN forecast_item.fi_text IS 'Label of the i	tem';
COMMENT ON COLUMN forecast_item.fi_account IS 'Accountancy entry';
COMMENT ON COLUMN forecast_item.fi_card IS 'Card (fiche.f_id)';
COMMENT ON COLUMN forecast_item.fi_order IS 'Order of showing (not used)';
COMMENT ON COLUMN forecast_item.fi_amount IS 'Amount';
COMMENT ON COLUMN forecast_item.fi_debit IS 'possible values are D or C';
COMMENT ON COLUMN forecast_item.fi_pid IS '0 for every month, or the value parm_periode.p_id ';
COMMENT ON TABLE form IS 'Forms content';
COMMENT ON TABLE info_def IS 'Contains the types of additionnal info we can add to a operation';
COMMENT ON TABLE jnt_fic_attr IS 'join between the family card and the attribut definition';
COMMENT ON TABLE jrn IS 'Journal: content one line for a group of accountancy writing';
COMMENT ON COLUMN jrn.jr_optype IS 'Type of operation , NOR = NORMAL , OPE opening , EXT extourne, CLO closing';
COMMENT ON TABLE jrn_def IS 'Definition of a journal, his properties';
COMMENT ON COLUMN jrn_def.jrn_enable IS 'Set to 1 if the ledger is enable ';
COMMENT ON TABLE jrn_note IS 'Note about operation';
COMMENT ON TABLE jrn_rapt IS 'Rapprochement between operation';
COMMENT ON TABLE jrn_type IS 'Type of journal (Sell, Buy, Financial...)';
COMMENT ON TABLE jrnx IS 'Journal: content one line for each accountancy writing';
COMMENT ON TABLE key_distribution IS 'Distribution key for analytic';
COMMENT ON COLUMN key_distribution.kd_id IS 'PK';
COMMENT ON COLUMN key_distribution.kd_name IS 'Name of the key';
COMMENT ON COLUMN key_distribution.kd_description IS 'Description of the key';
COMMENT ON TABLE key_distribution_activity IS 'Contains the analytic account';
COMMENT ON COLUMN key_distribution_activity.ka_id IS 'pk';
COMMENT ON COLUMN key_distribution_activity.ke_id IS 'fk to key_distribution_detail';
COMMENT ON COLUMN key_distribution_activity.po_id IS 'fk to poste_analytique';
COMMENT ON COLUMN key_distribution_activity.pa_id IS 'fk to plan_analytique';
COMMENT ON TABLE key_distribution_detail IS 'Row of activity and percent';
COMMENT ON COLUMN key_distribution_detail.ke_id IS 'pk';
COMMENT ON COLUMN key_distribution_detail.kd_id IS 'fk to key_distribution';
COMMENT ON COLUMN key_distribution_detail.ke_row IS 'group order';
COMMENT ON TABLE key_distribution_ledger IS 'Legder where the distribution key can be used';
COMMENT ON COLUMN key_distribution_ledger.kl_id IS 'pk';
COMMENT ON COLUMN key_distribution_ledger.kd_id IS 'fk to key_distribution';
COMMENT ON COLUMN key_distribution_ledger.jrn_def_id IS 'fk to jrnd_def, ledger where this key is available';
COMMENT ON COLUMN menu_ref.me_code IS 'Menu Code ';
COMMENT ON COLUMN menu_ref.me_menu IS 'Label to display';
COMMENT ON COLUMN menu_ref.me_file IS 'if not empty file to include';
COMMENT ON COLUMN menu_ref.me_url IS 'url ';
COMMENT ON COLUMN menu_ref.me_type IS 'ME for menu
PR for Printing
SP for special meaning (ex: return to line)
PL for plugin';
COMMENT ON TABLE mod_payment IS 'Contains the different media of payment and the corresponding ledger';
COMMENT ON COLUMN mod_payment.jrn_def_id IS 'Ledger using this payment method';
COMMENT ON TABLE op_predef IS 'predefined operation';
COMMENT ON COLUMN op_predef.jrn_def_id IS 'jrn_id';
COMMENT ON COLUMN op_predef.od_name IS 'name of the operation';
COMMENT ON TABLE op_predef_detail IS 'contains the detail of predefined operations';
COMMENT ON TABLE operation_analytique IS 'History of the analytic account';
COMMENT ON COLUMN operation_analytique.oa_jrnx_id_source IS 'jrnx.j_id source of this amount, this amount is computed from an amount giving a ND VAT.Normally NULL  is there is no ND VAT.';
COMMENT ON COLUMN operation_analytique.oa_positive IS 'Sign of the amount';
COMMENT ON COLUMN operation_analytique.f_id IS 'FK to fiche.f_id , used only with ODS';
COMMENT ON TABLE parameter IS 'parameter of the company';
COMMENT ON TABLE parm_money IS 'Currency conversion';
COMMENT ON TABLE parm_periode IS 'Periode definition';
COMMENT ON TABLE parm_poste IS 'Contains data for finding is the type of the account (asset)';
COMMENT ON TABLE plan_analytique IS 'Plan Analytique (max 5)';
COMMENT ON TABLE poste_analytique IS 'Poste Analytique';
COMMENT ON TABLE profile IS 'Available profile ';
COMMENT ON COLUMN profile.p_name IS 'Name of the profile';
COMMENT ON COLUMN profile.p_desc IS 'description of the profile';
COMMENT ON COLUMN profile.with_calc IS 'show the calculator';
COMMENT ON COLUMN profile.with_direct_form IS 'show the direct form';
COMMENT ON TABLE profile_menu IS 'Join  between the profile and the menu ';
COMMENT ON COLUMN profile_menu.me_code_dep IS 'menu code dependency';
COMMENT ON COLUMN profile_menu.p_id IS 'link to profile';
COMMENT ON COLUMN profile_menu.p_order IS 'order of displaying menu';
COMMENT ON COLUMN profile_menu.p_type_display IS 'M is a module
E is a menu
S is a select (for plugin)';
COMMENT ON COLUMN profile_menu.pm_default IS 'default menu';
COMMENT ON COLUMN profile_menu.pm_id_dep IS 'parent of this menu item';
COMMENT ON TABLE profile_sec_repository IS 'Available profile for user';
COMMENT ON COLUMN profile_sec_repository.ur_id IS 'pk';
COMMENT ON COLUMN profile_sec_repository.p_id IS 'fk to profile';
COMMENT ON COLUMN profile_sec_repository.r_id IS 'fk to stock_repository';
COMMENT ON COLUMN profile_sec_repository.ur_right IS 'Type of right : R for readonly W for write';
COMMENT ON TABLE profile_user IS 'Contains the available profile for users';
COMMENT ON COLUMN profile_user.user_name IS 'fk to available_user : login';
COMMENT ON COLUMN profile_user.p_id IS 'fk to profile';
COMMENT ON TABLE quant_fin IS 'Simple operation for financial';
COMMENT ON COLUMN quant_purchase.qp_vat_sided IS 'amount of the VAT which avoid VAT, case of the VAT which add the same amount at the deb and cred';
COMMENT ON TABLE quant_sold IS 'Contains about invoice for customer';
COMMENT ON TABLE stock_goods IS 'About the goods';
COMMENT ON TABLE stock_repository IS 'stock repository';
COMMENT ON COLUMN stock_repository.r_id IS 'pk';
COMMENT ON COLUMN stock_repository.r_name IS 'name of the stock';
COMMENT ON COLUMN stock_repository.r_adress IS 'adress of the stock';
COMMENT ON COLUMN stock_repository.r_country IS 'country of the stock';
COMMENT ON COLUMN stock_repository.r_city IS 'City of the stock';
COMMENT ON COLUMN stock_repository.r_phone IS 'Phone number';
COMMENT ON COLUMN tags.t_actif IS 'Y if the tag is activate and can be used ';
COMMENT ON TABLE tmp_pcmn IS 'Plan comptable minimum normalisé';
COMMENT ON COLUMN tmp_pcmn.id IS 'allow to identify the row, it is unique and not null (pseudo pk)';
COMMENT ON COLUMN tmp_pcmn.pcm_direct_use IS 'Value are N or Y , N cannot be used directly , not even through a card';
COMMENT ON TABLE todo_list IS 'Todo list';
COMMENT ON COLUMN todo_list.is_public IS 'Flag for the public parameter';
COMMENT ON TABLE todo_list_shared IS 'Note of todo list shared with other users';
COMMENT ON COLUMN todo_list_shared.todo_list_id IS 'fk to todo_list';
COMMENT ON COLUMN todo_list_shared.use_login IS 'user login';
COMMENT ON TABLE tva_rate IS 'Rate of vat';
COMMENT ON COLUMN user_active_security.us_login IS 'user''s login';
COMMENT ON COLUMN user_active_security.us_ledger IS 'Flag Security for ledger';
COMMENT ON COLUMN user_active_security.us_action IS 'Security for action';
COMMENT ON TABLE user_local_pref IS 'The user''s local parameter ';
COMMENT ON COLUMN user_local_pref.user_id IS 'user''s login ';
COMMENT ON COLUMN user_local_pref.parameter_type IS 'the type of parameter ';
COMMENT ON COLUMN user_local_pref.parameter_value IS 'the value of parameter ';
COMMENT ON TABLE user_sec_action_profile IS 'Available profile for user';
COMMENT ON COLUMN user_sec_action_profile.ua_id IS 'pk';
COMMENT ON COLUMN user_sec_action_profile.p_id IS 'fk to profile';
COMMENT ON COLUMN user_sec_action_profile.ua_right IS 'Type of right : R for readonly W for write';
COMMENT ON VIEW v_menu_description IS 'Description des menus';
COMMENT ON VIEW v_menu_profile IS 'Give the profile and the menu + dependencies';
COMMENT ON VIEW v_tva_rate IS 'Show this table to be easily used by  Tva_Rate_MTable';
COMMENT ON COLUMN v_tva_rate.tva_purchase IS ' VAT used for purchase';
COMMENT ON COLUMN v_tva_rate.tva_sale IS ' VAT used for sale';
COMMENT ON COLUMN v_tva_rate.tva_both_side IS 'if 1 ,  VAT avoided ';
COMMENT ON VIEW vw_fiche_def IS 'all the attributs for	card family';
COMMENT ON CONSTRAINT uniq_user_ledger ON user_sec_jrn IS 'Create an unique combination user / ledger';
COMMENT ON TRIGGER action_gestion_t_insert_update ON action_gestion IS 'Truncate the column ag_title to 70 char';
COMMENT ON TRIGGER profile_user_ins_upd ON profile_user IS 'Force the column user_name to lowercase';
COMMENT ON TRIGGER t_jrnx_ins ON jrnx IS 'check that the qcode used by the card exists and format it : uppercase and trim the space';
COMMENT ON TRIGGER t_letter_del ON jrnx IS 'Delete the lettering for this row';
COMMENT ON TRIGGER todo_list_ins_upd ON todo_list IS 'Force the column use_login to lowercase';
COMMENT ON TRIGGER todo_list_shared_ins_upd ON todo_list_shared IS 'Force the column ua_login to lowercase';
COMMENT ON TRIGGER user_sec_act_ins_upd ON user_sec_act IS 'Force the column ua_login to lowercase';
COMMENT ON TRIGGER user_sec_jrn_after_ins_upd ON user_sec_jrn IS 'Force the column uj_login to lowercase';
