merge with rel205
This commit is contained in:
parent
bbbd978f92
commit
9af16485ae
8 changed files with 206 additions and 146 deletions
|
|
@ -111,13 +111,13 @@
|
|||
<body>
|
||||
|
||||
<!-- Primary Index -->
|
||||
<p><br><br>Dumped on 2006-08-01</p>
|
||||
<p><br><br>Dumped on 2006-09-05</p>
|
||||
<h1><a name="index">Index of database - account_repository</a></h1>
|
||||
<ul>
|
||||
|
||||
<li><a name="public.schema">public</a></li><ul>
|
||||
<li><a href="#public.table.ac-dossier">ac_dossier</a></li><li><a href="#public.table.ac-users">ac_users</a></li><li><a href="#public.table.jnt-use-dos">jnt_use_dos</a></li><li><a href="#public.table.modeledef">modeledef</a></li><li><a href="#public.table.priv-user">priv_user</a></li><li><a href="#public.table.theme">theme</a></li><li><a href="#public.table.user-global-pref">user_global_pref</a></li><li><a href="#public.table.version">version</a></li>
|
||||
<li><a href="#public.function.plpgsql-validator-oid">plpgsql_validator( oid )</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
|
@ -405,7 +405,7 @@
|
|||
</tr>
|
||||
|
||||
<tr class="tr0">
|
||||
<td>$1</td>
|
||||
<td>ac_users_use_active_check</td>
|
||||
<td>CHECK (((use_active = 0) OR (use_active = 1)))</td>
|
||||
</tr>
|
||||
|
||||
|
|
@ -416,10 +416,6 @@
|
|||
|
||||
<p>Tables referencing this one via Foreign Key Constraints:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#public.table.jnt-use-dos">jnt_use_dos</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><a href="#public.table.user-global-pref">user_global_pref</a></li>
|
||||
</ul>
|
||||
|
|
@ -473,20 +469,12 @@
|
|||
<td>
|
||||
|
||||
|
||||
<a href="#public.table.ac-users">ac_users.use_id</a>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<td>use_id</td>
|
||||
<td>integer</td>
|
||||
<td><i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PRIMARY KEY
|
||||
|
||||
|
||||
|
|
@ -983,15 +971,6 @@
|
|||
|
||||
<!-- We've gone through the table structure, now lets take a look at user functions -->
|
||||
|
||||
<hr>
|
||||
<h2>Function:
|
||||
<a href="#public.schema"><a name="public.function.plpgsql-validator-oid">plpgsql_validator( oid )</a>
|
||||
</h2>
|
||||
<h3>Returns: void</h3>
|
||||
<h3>Language: C</h3>
|
||||
|
||||
<pre>plpgsql_validator</pre>
|
||||
|
||||
|
||||
|
||||
<p class="w3ref">Generated by <a href="http://www.rbt.ca/autodoc/">PostgreSQL Autodoc</a></p>
|
||||
|
|
|
|||
|
|
@ -3253,7 +3253,7 @@
|
|||
</dia:attribute>
|
||||
|
||||
<dia:attribute name="comment">
|
||||
<dia:string>#Table temporaire pour l'importation ... t CSV#</dia:string>
|
||||
<dia:string>##</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="abstract">
|
||||
<dia:boolean val="false"/>
|
||||
|
|
@ -3397,7 +3397,7 @@
|
|||
<dia:string># montant#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="type">
|
||||
<dia:string>#numeric(20,4)#</dia:string>
|
||||
<dia:string>#text#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="value">
|
||||
|
||||
|
|
@ -3530,6 +3530,29 @@
|
|||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
<dia:composite type="umlattribute">
|
||||
<dia:attribute name="name">
|
||||
<dia:string># status#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="type">
|
||||
<dia:string>#character varying(1)#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="value">
|
||||
|
||||
<dia:string>#'n'::character varying#</dia:string>
|
||||
|
||||
</dia:attribute>
|
||||
<dia:attribute name="visibility">
|
||||
<dia:enum val="3"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="abstract">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="class_scope">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
<dia:composite type="umlattribute">
|
||||
<dia:attribute name="name">
|
||||
<dia:string># bq_account#</dia:string>
|
||||
|
|
@ -3576,29 +3599,6 @@
|
|||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
<dia:composite type="umlattribute">
|
||||
<dia:attribute name="name">
|
||||
<dia:string># status#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="type">
|
||||
<dia:string>#character varying(1)#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="value">
|
||||
|
||||
<dia:string>#'n'::character varying#</dia:string>
|
||||
|
||||
</dia:attribute>
|
||||
<dia:attribute name="visibility">
|
||||
<dia:enum val="3"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="abstract">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="class_scope">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
</dia:attribute>
|
||||
|
||||
<dia:attribute name="visible_operations">
|
||||
|
|
@ -3608,7 +3608,7 @@
|
|||
|
||||
<dia:composite type="umloperation">
|
||||
<dia:attribute name="name">
|
||||
<dia:string>#chk_status#</dia:string>
|
||||
<dia:string>#import_tmp_status_check#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="visibility">
|
||||
<dia:enum val="3"/>
|
||||
|
|
@ -3622,7 +3622,7 @@
|
|||
<dia:attribute name="parameters">
|
||||
<dia:composite type="umlparameter">
|
||||
<dia:attribute name="name">
|
||||
<dia:string>#CHECK ((((((status)::text = 'n ... xt)))#</dia:string>
|
||||
<dia:string>#CHECK ((((((status)::text = 't ... xt)))#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="type">
|
||||
<dia:string>##</dia:string>
|
||||
|
|
@ -4128,6 +4128,29 @@
|
|||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
<dia:composite type="umlattribute">
|
||||
<dia:attribute name="name">
|
||||
<dia:string># jnt_id#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="type">
|
||||
<dia:string>#bigint#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="value">
|
||||
|
||||
<dia:string>#nextval('s_jnt_id ... lass)#</dia:string>
|
||||
|
||||
</dia:attribute>
|
||||
<dia:attribute name="visibility">
|
||||
<dia:enum val="3"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="abstract">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="class_scope">
|
||||
<dia:boolean val="false"/>
|
||||
</dia:attribute>
|
||||
</dia:composite>
|
||||
|
||||
</dia:attribute>
|
||||
|
||||
<dia:attribute name="visible_operations">
|
||||
|
|
@ -6810,7 +6833,7 @@
|
|||
|
||||
<dia:composite type="umloperation">
|
||||
<dia:attribute name="name">
|
||||
<dia:string>#$1#</dia:string>
|
||||
<dia:string>#parm_periode_check#</dia:string>
|
||||
</dia:attribute>
|
||||
<dia:attribute name="visibility">
|
||||
<dia:enum val="3"/>
|
||||
|
|
|
|||
|
|
@ -111,13 +111,13 @@
|
|||
<body>
|
||||
|
||||
<!-- Primary Index -->
|
||||
<p><br><br>Dumped on 2006-08-01</p>
|
||||
<p><br><br>Dumped on 2006-09-05</p>
|
||||
<h1><a name="index">Index of database - dossier1</a></h1>
|
||||
<ul>
|
||||
|
||||
<li><a name="public.schema">public</a></li><ul>
|
||||
<li><a href="#public.table.action">action</a></li><li><a href="#public.table.action-gestion">action_gestion</a></li><li><a href="#public.table.attr-def">attr_def</a></li><li><a href="#public.table.attr-min">attr_min</a></li><li><a href="#public.table.attr-value">attr_value</a></li><li><a href="#public.table.centralized">centralized</a></li><li><a href="#public.table.document">document</a></li><li><a href="#public.table.document-modele">document_modele</a></li><li><a href="#public.table.document-state">document_state</a></li><li><a href="#public.table.document-type">document_type</a></li><li><a href="#public.table.fiche">fiche</a></li><li><a href="#public.table.fiche-def">fiche_def</a></li><li><a href="#public.table.fiche-def-ref">fiche_def_ref</a></li><li><a href="#public.table.form">form</a></li><li><a href="#public.table.format-csv-banque">format_csv_banque</a></li><li><a href="#public.table.formdef">formdef</a></li><li><a href="#public.table.import-tmp">import_tmp</a></li><li><a href="#public.table.invoice">invoice</a></li><li><a href="#public.table.jnt-fic-att-value">jnt_fic_att_value</a></li><li><a href="#public.table.jnt-fic-attr">jnt_fic_attr</a></li><li><a href="#public.table.jrn">jrn</a></li><li><a href="#public.table.jrn-action">jrn_action</a></li><li><a href="#public.table.jrn-def">jrn_def</a></li><li><a href="#public.table.jrn-rapt">jrn_rapt</a></li><li><a href="#public.table.jrn-type">jrn_type</a></li><li><a href="#public.table.jrnx">jrnx</a></li><li><a href="#public.table.parameter">parameter</a></li><li><a href="#public.table.parm-code">parm_code</a></li><li><a href="#public.table.parm-money">parm_money</a></li><li><a href="#public.table.parm-periode">parm_periode</a></li><li><a href="#public.table.quant-sold">quant_sold</a></li><li><a href="#public.table.stock-goods">stock_goods</a></li><li><a href="#public.table.tmp-pcmn">tmp_pcmn</a></li><li><a href="#public.table.tva-rate">tva_rate</a></li><li><a href="#public.table.user-local-pref">user_local_pref</a></li><li><a href="#public.table.user-sec-act">user_sec_act</a></li><li><a href="#public.table.user-sec-jrn">user_sec_jrn</a></li><li><a href="#public.table.version">version</a></li><li><a href="#public.view.vw-client">vw_client</a></li><li><a href="#public.view.vw-fiche-attr">vw_fiche_attr</a></li><li><a href="#public.view.vw-fiche-def">vw_fiche_def</a></li><li><a href="#public.view.vw-fiche-min">vw_fiche_min</a></li><li><a href="#public.view.vw-poste-qcode">vw_poste_qcode</a></li><li><a href="#public.view.vw-supplier">vw_supplier</a></li>
|
||||
<li><a href="#public.function.account-add-p-id-public.poste-comptable-p-name-character-varying">account_add( p_id public.poste_comptable, p_name character varying )</a></li><li><a href="#public.function.account-auto-p-fd-id-integer">account_auto( p_fd_id integer )</a></li><li><a href="#public.function.account-compute-p-f-id-integer">account_compute( p_f_id integer )</a></li><li><a href="#public.function.account-insert-p-f-id-integer-p-account-public.poste-comptable">account_insert( p_f_id integer, p_account public.poste_comptable )</a></li><li><a href="#public.function.account-parent-p-account-public.poste-comptable">account_parent( p_account public.poste_comptable )</a></li><li><a href="#public.function.account-update-p-f-id-integer-p-account-public.poste-comptable">account_update( p_f_id integer, p_account public.poste_comptable )</a></li><li><a href="#public.function.attribut-insert-p-f-id-integer-p-ad-id-integer-p-value-character-varying">attribut_insert( p_f_id integer, p_ad_id integer, p_value character varying )</a></li><li><a href="#public.function.card-class-base-p-f-id-integer">card_class_base( p_f_id integer )</a></li><li><a href="#public.function.check-balance-p-grpt-integer">check_balance( p_grpt integer )</a></li><li><a href="#public.function.fiche-account-parent-p-f-id-integer">fiche_account_parent( p_f_id integer )</a></li><li><a href="#public.function.insert-jrnx-p-date-character-varying-p-montant-numeric-p-poste-integer-p-grpt-integer-p-jrn-def-integer-p-debit-boolean-p-tech-user-text-p-tech-per-integer-p-qcode-text">insert_jrnx( p_date character varying, p_montant numeric, p_poste integer, p_grpt integer, p_jrn_def integer, p_debit boolean, p_tech_user text, p_tech_per integer, p_qcode text )</a></li><li><a href="#public.function.insert-quant-sold-p-internal-text-p-fiche-character-varying-p-quant-integer-p-price-numeric-p-vat-numeric-p-vat-code-integer-p-client-character-varying">insert_quant_sold( p_internal text, p_fiche character varying, p_quant integer, p_price numeric, p_vat numeric, p_vat_code integer, p_client character varying )</a></li><li><a href="#public.function.insert-quick-code-nf-id-integer-tav-text-text">insert_quick_code( nf_id integer, tav_text text )</a></li><li><a href="#public.function.plpgsql-validator-oid">plpgsql_validator( oid )</a></li><li><a href="#public.function.proc-check-balance">proc_check_balance( )</a></li><li><a href="#public.function.t-document-type-insert">t_document_type_insert( )</a></li><li><a href="#public.function.t-jrn-def-sequence">t_jrn_def_sequence( )</a></li><li><a href="#public.function.trim-cvs-quote">trim_cvs_quote( )</a></li><li><a href="#public.function.trim-space-format-csv-banque">trim_space_format_csv_banque( )</a></li><li><a href="#public.function.tva-delete-integer">tva_delete( integer )</a></li><li><a href="#public.function.tva-insert-integer-text-numeric-text-text">tva_insert( integer, text, numeric, text, text )</a></li><li><a href="#public.function.tva-modify-integer-text-numeric-text-text">tva_modify( integer, text, numeric, text, text )</a></li><li><a href="#public.function.update-quick-code-njft-id-integer-tav-text-text">update_quick_code( njft_id integer, tav_text text )</a></li>
|
||||
<li><a href="#public.function.account-add-p-id-public.poste-comptable-p-name-character-varying">account_add( p_id public.poste_comptable, p_name character varying )</a></li><li><a href="#public.function.account-auto-p-fd-id-integer">account_auto( p_fd_id integer )</a></li><li><a href="#public.function.account-compute-p-f-id-integer">account_compute( p_f_id integer )</a></li><li><a href="#public.function.account-insert-p-f-id-integer-p-account-public.poste-comptable">account_insert( p_f_id integer, p_account public.poste_comptable )</a></li><li><a href="#public.function.account-parent-p-account-public.poste-comptable">account_parent( p_account public.poste_comptable )</a></li><li><a href="#public.function.account-update-p-f-id-integer-p-account-public.poste-comptable">account_update( p_f_id integer, p_account public.poste_comptable )</a></li><li><a href="#public.function.attribut-insert-p-f-id-integer-p-ad-id-integer-p-value-character-varying">attribut_insert( p_f_id integer, p_ad_id integer, p_value character varying )</a></li><li><a href="#public.function.card-class-base-p-f-id-integer">card_class_base( p_f_id integer )</a></li><li><a href="#public.function.check-balance-p-grpt-integer">check_balance( p_grpt integer )</a></li><li><a href="#public.function.correct-sequence-p-sequence-text-p-col-text-p-table-text">correct_sequence( p_sequence text, p_col text, p_table text )</a></li><li><a href="#public.function.fiche-account-parent-p-f-id-integer">fiche_account_parent( p_f_id integer )</a></li><li><a href="#public.function.insert-jrnx-p-date-character-varying-p-montant-numeric-p-poste-integer-p-grpt-integer-p-jrn-def-integer-p-debit-boolean-p-tech-user-text-p-tech-per-integer-p-qcode-text">insert_jrnx( p_date character varying, p_montant numeric, p_poste integer, p_grpt integer, p_jrn_def integer, p_debit boolean, p_tech_user text, p_tech_per integer, p_qcode text )</a></li><li><a href="#public.function.insert-quant-sold-p-internal-text-p-fiche-character-varying-p-quant-integer-p-price-numeric-p-vat-numeric-p-vat-code-integer-p-client-character-varying">insert_quant_sold( p_internal text, p_fiche character varying, p_quant integer, p_price numeric, p_vat numeric, p_vat_code integer, p_client character varying )</a></li><li><a href="#public.function.insert-quick-code-nf-id-integer-tav-text-text">insert_quick_code( nf_id integer, tav_text text )</a></li><li><a href="#public.function.proc-check-balance">proc_check_balance( )</a></li><li><a href="#public.function.t-document-type-insert">t_document_type_insert( )</a></li><li><a href="#public.function.t-jrn-def-sequence">t_jrn_def_sequence( )</a></li><li><a href="#public.function.trim-cvs-quote">trim_cvs_quote( )</a></li><li><a href="#public.function.trim-space-format-csv-banque">trim_space_format_csv_banque( )</a></li><li><a href="#public.function.tva-delete-integer">tva_delete( integer )</a></li><li><a href="#public.function.tva-insert-integer-text-numeric-text-text">tva_insert( integer, text, numeric, text, text )</a></li><li><a href="#public.function.tva-modify-integer-text-numeric-text-text">tva_modify( integer, text, numeric, text, text )</a></li><li><a href="#public.function.update-quick-code-njft-id-integer-tav-text-text">update_quick_code( njft_id integer, tav_text text )</a></li>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
|
@ -2105,8 +2105,6 @@
|
|||
<a name="public.table.import-tmp">import_tmp</a>
|
||||
</h2>
|
||||
|
||||
<p>Table temporaire pour l'importation des banques en format CSV</p>
|
||||
|
||||
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="3">
|
||||
|
|
@ -2127,7 +2125,7 @@
|
|||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
|
||||
</i>
|
||||
|
||||
|
|
@ -2143,7 +2141,7 @@
|
|||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
|
||||
</i>
|
||||
|
||||
|
|
@ -2159,7 +2157,7 @@
|
|||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
|
||||
</i>
|
||||
|
||||
|
|
@ -2171,11 +2169,11 @@
|
|||
|
||||
</td>
|
||||
<td>montant</td>
|
||||
<td>numeric(20,4)</td>
|
||||
<td>text</td>
|
||||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
|
||||
</i>
|
||||
|
||||
|
|
@ -2266,13 +2264,13 @@
|
|||
<td>
|
||||
|
||||
</td>
|
||||
<td>bq_account</td>
|
||||
<td>integer</td>
|
||||
<td>status</td>
|
||||
<td>character varying(1)</td>
|
||||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
DEFAULT 'n'::character varying
|
||||
</i>
|
||||
|
||||
</td>
|
||||
|
|
@ -2282,7 +2280,7 @@
|
|||
<td>
|
||||
|
||||
</td>
|
||||
<td>jrn</td>
|
||||
<td>bq_account</td>
|
||||
<td>integer</td>
|
||||
<td><i>
|
||||
|
||||
|
|
@ -2298,15 +2296,15 @@
|
|||
<td>
|
||||
|
||||
</td>
|
||||
<td>status</td>
|
||||
<td>character varying(1)</td>
|
||||
<td>jrn</td>
|
||||
<td>integer</td>
|
||||
<td><i>
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
DEFAULT 'n'::character varying
|
||||
</i>
|
||||
<br><br>Status doit être w pour en attente, t pour transfèrer ou d à effacer
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
@ -2327,8 +2325,8 @@
|
|||
</tr>
|
||||
|
||||
<tr class="tr0">
|
||||
<td>chk_status</td>
|
||||
<td>CHECK ((((((status)::text = 'n'::text) OR ((status)::text = 'w'::text)) OR ((status)::text = 'd'::text)) OR ((status)::text = 't'::text)))</td>
|
||||
<td>import_tmp_status_check</td>
|
||||
<td>CHECK ((((((status)::text = 't'::text) OR ((status)::text = 'd'::text)) OR ((status)::text = 'w'::text)) OR ((status)::text = 'n'::text)))</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
|
@ -2622,6 +2620,29 @@
|
|||
|
||||
|
||||
|
||||
</i>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="tr0">
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<td>jnt_id</td>
|
||||
<td>bigint</td>
|
||||
<td><i>
|
||||
|
||||
PRIMARY KEY
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFAULT nextval('s_jnt_id'::regclass)
|
||||
</i>
|
||||
|
||||
</td>
|
||||
|
|
@ -4247,19 +4268,11 @@
|
|||
<tr class="tr1">
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
<td>p_start</td>
|
||||
<td>date</td>
|
||||
<td><i>
|
||||
|
||||
|
||||
|
||||
|
||||
UNIQUE
|
||||
|
||||
|
||||
|
||||
NOT NULL
|
||||
|
||||
|
|
@ -4349,7 +4362,7 @@
|
|||
</tr>
|
||||
|
||||
<tr class="tr0">
|
||||
<td>$1</td>
|
||||
<td>parm_periode_check</td>
|
||||
<td>CHECK ((p_end >= p_start))</td>
|
||||
</tr>
|
||||
|
||||
|
|
@ -7285,7 +7298,6 @@ end ;
|
|||
declare
|
||||
l_auto bool;
|
||||
begin
|
||||
|
||||
select fd_create_account into l_auto from fiche_def where fd_id=p_fd_id;
|
||||
if l_auto is null then
|
||||
l_auto:=false;
|
||||
|
|
@ -7306,19 +7318,19 @@ declare
|
|||
class_base poste_comptable;
|
||||
maxcode int8;
|
||||
begin
|
||||
-- Get the class base
|
||||
select fd_class_base into class_base
|
||||
from
|
||||
fiche_def join fiche using (fd_id)
|
||||
where
|
||||
f_id=p_f_id;
|
||||
raise notice 'class base %',class_base;
|
||||
select max(pcm_val) into maxcode from tmp_pcmn where pcm_val = class_base;
|
||||
raise notice 'account_compute class base %',class_base;
|
||||
select max(pcm_val) into maxcode from tmp_pcmn where pcm_val_parent = class_base;
|
||||
if maxcode = class_base then
|
||||
maxcode=class_base*1000+1;
|
||||
maxcode:=class_base*1000;
|
||||
end if;
|
||||
raise notice 'Max code %',maxcode;
|
||||
return maxcode+1;
|
||||
maxcode:=maxcode+1;
|
||||
raise notice 'account_compute Max code %',maxcode;
|
||||
return maxcode;
|
||||
end;
|
||||
</pre>
|
||||
|
||||
|
|
@ -7339,51 +7351,40 @@ nFd_id integer;
|
|||
nCount integer;
|
||||
begin
|
||||
|
||||
-- if p_value empty
|
||||
if length(trim(p_account)) != 0 then
|
||||
-- does the account exist ?
|
||||
raise notice 'p_account is not empty';
|
||||
select * into nCount from tmp_pcmn where pcm_val=p_account;
|
||||
if nCount !=0 then
|
||||
-- retrieve name
|
||||
raise notice 'this account exists in tmp_pcmn ';
|
||||
select av_text into sName from
|
||||
attr_value join jnt_fic_att_value using (jft_id)
|
||||
where
|
||||
ad_id=1 and f_id=p_f_id;
|
||||
-- get parent
|
||||
nParent:=account_parent(p_account);
|
||||
-- account doesn't exist we need to add id
|
||||
insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent)
|
||||
values (p_account,sName,nParent);
|
||||
-- insert as card's attribute
|
||||
perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999'));
|
||||
|
||||
end if;
|
||||
else
|
||||
raise notice 'p_account is empty';
|
||||
select fd_id into nFd_id from fiche where f_id=p_f_id;
|
||||
bAuto:= account_auto(nFd_id);
|
||||
|
||||
if bAuto = true then
|
||||
-- create automatically the account
|
||||
-- compute the next account
|
||||
raise notice 'account generated automatically';
|
||||
nNew:=account_compute(p_f_id);
|
||||
raise debug 'nNew %', nNew;
|
||||
-- retrieve name
|
||||
raise notice 'nNew %', nNew;
|
||||
select av_text into sName from
|
||||
attr_value join jnt_fic_att_value using (jft_id)
|
||||
where
|
||||
ad_id=1 and f_id=p_f_id;
|
||||
|
||||
-- get parent
|
||||
nParent:=account_parent(nNew);
|
||||
-- account doesn't exist we need to add id
|
||||
perform account_add (nNew,sName);
|
||||
-- insert as card's attribute
|
||||
perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999'));
|
||||
|
||||
else
|
||||
perform attribut_insert(p_f_id,5,null);
|
||||
end if;
|
||||
|
||||
end if;
|
||||
|
||||
return 0;
|
||||
|
|
@ -7418,9 +7419,8 @@ begin
|
|||
if length(sParent) <= 0 then
|
||||
raise exception 'Impossible de trouver le compte parent pour %',p_account;
|
||||
end if;
|
||||
|
||||
end loop;
|
||||
|
||||
raise notice 'account_parent : Parent is %',nParent;
|
||||
return nParent;
|
||||
end;
|
||||
</pre>
|
||||
|
|
@ -7441,25 +7441,18 @@ sName varchar;
|
|||
nJft_id attr_value.jft_id%type;
|
||||
begin
|
||||
|
||||
-- if p_value empty
|
||||
if length(trim(p_account)) != 0 then
|
||||
-- does the account exist ?
|
||||
select count(*) into nCount from tmp_pcmn where pcm_val=p_account;
|
||||
if nCount = 0 then
|
||||
-- retrieve name
|
||||
select av_text into sName from
|
||||
attr_value join jnt_fic_att_value using (jft_id)
|
||||
where
|
||||
ad_id=1 and f_id=p_f_id;
|
||||
-- get parent
|
||||
nParent:=fiche_account_parent(p_f_id);
|
||||
-- account doesn't exist we need to add id
|
||||
insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account,sName,nParent);
|
||||
end if;
|
||||
end if;
|
||||
-- we retrieve jft_id
|
||||
select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5;
|
||||
-- we update the account
|
||||
update attr_value set av_text=p_account where jft_id=njft_id;
|
||||
|
||||
return njft_id;
|
||||
|
|
@ -7492,18 +7485,18 @@ end;
|
|||
<h3>Language: PLPGSQL</h3>
|
||||
|
||||
<pre>
|
||||
|
||||
declare
|
||||
n_poste fiche_def.fd_class_base%type;
|
||||
begin
|
||||
|
||||
select fd_class_base into n_poste from fiche_def join fiche using (fd_id)
|
||||
select fd_class_base into n_poste from fiche_def join fiche using
|
||||
(fd_id)
|
||||
where f_id=p_f_id;
|
||||
if not FOUND then
|
||||
raise exception 'Invalid fiche card_class_base(%)',p_f_id;
|
||||
end if;
|
||||
return n_poste;
|
||||
end;
|
||||
end;
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
|
|
@ -7524,18 +7517,15 @@ begin
|
|||
where
|
||||
j_grpt=p_grpt
|
||||
and j_debit=false;
|
||||
|
||||
select sum (j_montant) into amount_jrnx_debit
|
||||
from jrnx
|
||||
where
|
||||
j_grpt=p_grpt
|
||||
and j_debit=true;
|
||||
|
||||
select jr_montant into amount_jrn
|
||||
from jrn
|
||||
where
|
||||
jr_grpt_id=p_grpt;
|
||||
|
||||
if ( amount_jrnx_debit != amount_jrnx_credit )
|
||||
then
|
||||
return abs(amount_jrnx_debit-amount_jrnx_credit);
|
||||
|
|
@ -7545,6 +7535,43 @@ begin
|
|||
return -1*abs(amount_jrn - amount_jrnx_credit);
|
||||
end if;
|
||||
return 0;
|
||||
end;
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
<h2>Function:
|
||||
<a href="#public.schema"><a name="public.function.correct-sequence-p-sequence-text-p-col-text-p-table-text">correct_sequence( p_sequence text, p_col text, p_table text )</a>
|
||||
</h2>
|
||||
<h3>Returns: integer</h3>
|
||||
<h3>Language: PLPGSQL</h3>
|
||||
<p> 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</p>
|
||||
<pre>
|
||||
declare
|
||||
last_sequence int8;
|
||||
max_sequence int8;
|
||||
n integer;
|
||||
begin
|
||||
select count(*) into n from pg_class where relkind='S' and relname=lower(p_sequence);
|
||||
if n = 0 then
|
||||
raise exception ' Unknow sequence % ',p_sequence;
|
||||
end if;
|
||||
select count(*) into n from pg_class where relkind='r' and relname=lower(p_table);
|
||||
if n = 0 then
|
||||
raise exception ' Unknow table % ',p_table;
|
||||
end if;
|
||||
|
||||
execute 'select last_value from '||p_sequence into last_sequence;
|
||||
raise notice 'Last value of the sequence is %', last_sequence;
|
||||
|
||||
execute 'select max('||p_col||') from '||p_table into max_sequence;
|
||||
if max_sequence is null then
|
||||
max_sequence := 0;
|
||||
end if;
|
||||
raise notice 'Max value of the sequence is %', max_sequence;
|
||||
max_sequence:= max_sequence +1;
|
||||
execute 'alter sequence '||p_sequence||' restart with '||max_sequence;
|
||||
return 0;
|
||||
|
||||
end;
|
||||
</pre>
|
||||
|
||||
|
|
@ -7580,14 +7607,9 @@ declare
|
|||
nCount_qcode integer;
|
||||
begin
|
||||
sCode=trim(p_qcode);
|
||||
|
||||
-- if p_qcode is empty try to find one
|
||||
if length(sCode) = 0 or p_qcode is null then
|
||||
|
||||
select count(*) into nCount_qcode
|
||||
from vw_poste_qcode where j_poste=p_poste;
|
||||
-- if we find only one q_code for a accountancy account
|
||||
-- then retrieve it
|
||||
if nCount_qcode = 1 then
|
||||
select j_qcode into sCode
|
||||
from vw_poste_qcode where j_poste=p_poste;
|
||||
|
|
@ -7622,7 +7644,6 @@ begin
|
|||
p_tech_per,
|
||||
sCode
|
||||
);
|
||||
|
||||
return;
|
||||
end;
|
||||
</pre>
|
||||
|
|
@ -7640,10 +7661,10 @@ declare
|
|||
fid_good integer;
|
||||
begin
|
||||
select f_id into fid_client from
|
||||
attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=p_client;
|
||||
attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_client);
|
||||
|
||||
select f_id into fid_good from
|
||||
attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=p_fiche;
|
||||
attr_value join jnt_fic_att_value using (jft_id) where ad_id=23 and av_text=upper(p_fiche);
|
||||
|
||||
|
||||
insert into quant_sold
|
||||
|
|
@ -7652,7 +7673,7 @@ begin
|
|||
(p_internal,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client);
|
||||
return;
|
||||
end;
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
<h2>Function:
|
||||
|
|
@ -7671,39 +7692,25 @@ end;
|
|||
tText := replace(tText,' ','');
|
||||
|
||||
loop
|
||||
-- take the next sequence
|
||||
select nextval('s_jnt_fic_att_value') into ns;
|
||||
if length (tText) = 0 or tText is null then
|
||||
tText := 'FID'||ns;
|
||||
end if;
|
||||
-- av_text already used ?
|
||||
select count(*) into nExist
|
||||
from jnt_fic_att_value join attr_value using (jft_id)
|
||||
where
|
||||
ad_id=23 and av_text=upper(tText);
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
end if;
|
||||
tText:='FID'||ns;
|
||||
end loop;
|
||||
-- insert into table jnt_fic_att_value
|
||||
insert into jnt_fic_att_value values (ns,nf_id,23);
|
||||
-- insert value into attr_value
|
||||
insert into attr_value values (ns,upper(tText));
|
||||
return ns;
|
||||
end;
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
<h2>Function:
|
||||
<a href="#public.schema"><a name="public.function.plpgsql-validator-oid">plpgsql_validator( oid )</a>
|
||||
</h2>
|
||||
<h3>Returns: void</h3>
|
||||
<h3>Language: C</h3>
|
||||
|
||||
<pre>plpgsql_validator</pre>
|
||||
|
||||
<hr>
|
||||
<h2>Function:
|
||||
<a href="#public.schema"><a name="public.function.proc-check-balance">proc_check_balance( )</a>
|
||||
|
|
@ -7797,7 +7804,6 @@ begin
|
|||
if ( length(modified.include_file) = 0 ) then
|
||||
modified.include_file=null;
|
||||
end if;
|
||||
|
||||
return modified;
|
||||
end;
|
||||
</pre>
|
||||
|
|
@ -7885,7 +7891,6 @@ begin
|
|||
if length(trim(p_tva_label)) = 0 then
|
||||
return 3;
|
||||
end if;
|
||||
|
||||
if length(trim(p_tva_poste)) != 0 then
|
||||
if position (',' in p_tva_poste) = 0 then return 4; end if;
|
||||
debit = split_part(p_tva_poste,',',1);
|
||||
|
|
@ -7936,7 +7941,7 @@ end;
|
|||
select count(*) into nExist
|
||||
from jnt_fic_att_value join attr_value using (jft_id)
|
||||
where
|
||||
ad_id=23 and av_text=upper(tText);
|
||||
ad_id=23 and av_text=tText;
|
||||
|
||||
if nExist = 0 then
|
||||
exit;
|
||||
|
|
@ -7949,6 +7954,15 @@ end;
|
|||
|
||||
end loop;
|
||||
update attr_value set av_text = tText where jft_id=njft_id;
|
||||
|
||||
-- update also the contact
|
||||
update attr_value set av_text = tText
|
||||
where jft_id in
|
||||
( select jft_id
|
||||
from jnt_fic_att_value join attr_value using (jft_id)
|
||||
where ad_id=25 and av_text=old_qcode);
|
||||
|
||||
|
||||
update jrnx set j_qcode=tText where j_qcode = old_qcode;
|
||||
return ns;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -99,5 +99,24 @@ CREATE or replace FUNCTION update_quick_code(njft_id integer, tav_text text) RET
|
|||
end;
|
||||
$body$
|
||||
LANGUAGE plpgsql;
|
||||
alter table parm_periode alter p_end set not null;
|
||||
|
||||
create or replace function drop_it (p_constraint varchar)
|
||||
returns void as
|
||||
$body$
|
||||
declare
|
||||
-- drop a constraint if it exists
|
||||
nCount integer;
|
||||
begin
|
||||
select count(*) into nCount from pg_constraint where conname=p_constraint;
|
||||
if nCount = 1 then
|
||||
execute 'alter table parm_periode drop constraint '||p_constraint ;
|
||||
end if;
|
||||
end;
|
||||
$body$ language plpgsql;
|
||||
|
||||
select drop_it('parm_periode_p_start_key');
|
||||
create unique index x_periode on parm_periode (p_start,p_end);
|
||||
|
||||
update version set val=21;
|
||||
commit;
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ if ( $User->CheckAction($cn,FORM)==0){
|
|||
}
|
||||
echo ShowMenuAdvanced("form.php");
|
||||
if ( isset ($_POST["record"] )) {
|
||||
echo '<DIV class="u_redcontent">';
|
||||
// echo '<DIV class="u_redcontent">';
|
||||
AddForm($cn,$HTTP_POST_VARS);
|
||||
echo "</DIV>";
|
||||
//echo "</DIV>";
|
||||
}
|
||||
if ( isset ($_POST["del_form"]) ) {
|
||||
echo '<DIV class="u_redcontent">';
|
||||
|
|
|
|||
|
|
@ -56,6 +56,19 @@ if ( isset ($_POST["update"] ) ) {
|
|||
$p_lib=FormatString($_POST["p_name"]);
|
||||
$p_parent=trim($_POST["p_val_parent"]);
|
||||
$old_line=trim($_POST["p_old"]);
|
||||
// Check if p_parent and p_val are number
|
||||
if ( ! is_numeric($p_val) || ! is_numeric($p_parent) ) {
|
||||
// not number no update
|
||||
echo '<script> alert(\' Valeurs invalides, pas de changement opéré;\');
|
||||
</script>';
|
||||
echo "<script>
|
||||
window.close();
|
||||
self.opener.RefreshMe();
|
||||
|
||||
</script>";
|
||||
exit();
|
||||
|
||||
}
|
||||
echo_debug('line_update.php',__LINE__,"Update old : $old_line News = $p_val $p_lib");
|
||||
if ( strlen ($p_val) != 0 && strlen ($p_lib) != 0 && strlen($old_line)!=0 ) {
|
||||
if (strlen ($p_val) == 1 ) {
|
||||
|
|
|
|||
|
|
@ -102,10 +102,15 @@ function isDate ( $p_date) {
|
|||
return null;
|
||||
} else {
|
||||
$l_date=explode(".",$p_date);
|
||||
|
||||
if ( sizeof ($p_date) != 3 )
|
||||
return null;
|
||||
|
||||
if ( $l_date[2] > 2020 ) {
|
||||
return null;
|
||||
}
|
||||
echo_debug('ac_common.php',__LINE__,' date = '.var_export($l_date,true));
|
||||
|
||||
if ( checkdate ($l_date[1],$l_date[0],$l_date[2]) == false) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,13 @@ if ( isset($_POST['view'] ) ) {
|
|||
echo "<h2 class=\"info\"> période du ".$a['p_start']." au ".$b['p_end']."</h2>";
|
||||
|
||||
echo '<table width="100%">';
|
||||
echo '<th>Poste Comptable</th>';
|
||||
echo '<th>Libellé</th>';
|
||||
echo '<th>Débit</th>';
|
||||
echo '<th>Crédit</th>';
|
||||
echo '<th>Solde Débiteur </th>';
|
||||
echo '<th>Solde Créditeur</th>';
|
||||
|
||||
$i=0;
|
||||
foreach ($row as $r) {
|
||||
$i++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue