diff --git a/doc/developper/account_repository.html b/doc/developper/account_repository.html index 5cf9da960..e2c5e14f9 100644 --- a/doc/developper/account_repository.html +++ b/doc/developper/account_repository.html @@ -111,7 +111,7 @@
-
Dumped on 2006-07-06
Dumped on 2006-07-12
Dumped on 2006-07-06
Dumped on 2006-07-12
+ Index - + Schema public +
+ +Action for Managing
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +ag_id | +serial | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +ag_type | +integer | ++ + + + + + + | +
| + + | +f_id_dest | +integer | ++ + + NOT NULL + + + + | +
| + + | +f_id_exp | +integer | ++ + + NOT NULL + + + + | +
| + + | +ag_title | +character varying(70) | ++ + + + + + + | +
| + + | +ag_timestamp | +timestamp without time zone | ++ + + + DEFAULT now() + + + | +
| + + | +ag_cal | +character(1) | ++ + + + DEFAULT 'C'::bpchar + + + | +
| + + | +ag_ref_ag_id | +integer | ++ + + + + + + | +
| + + | +ag_comment | +text | ++ + + + + + + | +
| + + | +ag_ref | +text | ++ + + + + + + | +
+ Index - + Schema public +
+ +This table contains all the documents : summary and lob files
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +d_id | +serial | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +ag_id | +integer | ++ + + NOT NULL + + + + | +
| + + | +d_lob | +oid | ++ + + + + + + | +
| + + | +d_number | +bigint | ++ + + NOT NULL + + + + | +
| + + | +d_filename | +text | ++ + + + + + + | +
| + + | +d_mimetype | +text | ++ + + + + + + | +
| + + | +d_state | +integer | ++ + + + + + + | +
+ Index - + Schema public +
+ +contains all the template for the documents
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +md_id | +serial | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +md_name | +text | ++ + + NOT NULL + + + + | +
| + + | +md_lob | +oid | ++ + + + + + + | +
| + + + document_type.dt_id + + + | +md_type | +integer | ++ + + + + + + NOT NULL + + + + | +
| + + | +md_filename | +text | ++ + + + + + + | +
| + + | +md_mimetype | +text | ++ + + + + + + | +
+ Index - + Schema public +
+ +State of the document
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +s_id | +serial | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +s_value | +character varying(50) | ++ + + NOT NULL + + + + | +
+ Index - + Schema public +
+ +Type of document : meeting, invoice,...
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +dt_id | +serial | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +dt_value | +character varying(80) | ++ + + + + + + | +
Tables referencing this one via Foreign Key Constraints:
+ ++ Index - + Schema public +
+ +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +name | +text | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +include_file | +text | ++ + + NOT NULL + + + + | +
+ Index - + Schema public +
+ +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + | +code | +text | ++ + + NOT NULL + + + + | +
| + + | +date_exec | +date | ++ + + NOT NULL + + + + | +
| + + | +date_valeur | +date | ++ + + NOT NULL + + + + | +
| + + | +montant | +numeric(20,4) | ++ + + NOT NULL + + + + | +
| + + | +devise | +text | ++ + + + + + + | +
| + + | +compte_ordre | +text | ++ + + + + + + | +
| + + | +detail | +text | ++ + + + + + + | +
| + + | +num_compte | +text | ++ + + + + + + | +
| + + | +poste_comptable | +text | ++ + + + + + + | +
| + + | +ok | +boolean | ++ + + + DEFAULT false + + + | +
| + + | +bq_account | +integer | ++ + + NOT NULL + + + + | +
| + + | +jrn | +integer | ++ + + NOT NULL + + + + | +
+ Index - + Schema public +
+ +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +iv_id | +integer | ++ + PRIMARY KEY + + + + + + + DEFAULT nextval(('s_invoice'::text)::regclass) + + + | +
| + + | +iv_name | +text | ++ + + NOT NULL + + + + | +
| + + | +iv_file | +oid | ++ + + + + + + | +
+ Index - + Schema public +
+ +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +p_code | +text | ++ + PRIMARY KEY + + + + + + + + + + | +
| + + | +p_value | +text | ++ + + + + + + | +
| + + | +p_comment | +text | ++ + + + + + + | +
+ Index - + Schema public +
+ +Contains about invoice for customer
+ + + +| F-Key | +Name | +Type | +Description | +
|---|---|---|---|
| + + + + | +qs_id | +integer | ++ + PRIMARY KEY + + + + + + + DEFAULT nextval(('s_quantity'::text)::regclass) + + + | +
| + + | +qs_internal | +text | ++ + + NOT NULL + + + + | +
| + + | +qs_fiche | +integer | ++ + + NOT NULL + + + + | +
| + + | +qs_quantite | +integer | ++ + + NOT NULL + + + + | +
| + + | +qs_price | +numeric(20,4) | ++ + + + + + + | +
| + + | +qs_vat | +numeric(20,4) | ++ + + + + + + | +
| + + | +qs_vat_code | +integer | ++ + + + + + + | +
| + + | +qs_client | +integer | ++ + + NOT NULL + + + + | +
Index - Schema public @@ -3188,7 +4564,7 @@ - DEFAULT nextval('s_stock_goods'::text) + DEFAULT nextval(('s_stock_goods'::text)::regclass) @@ -3385,7 +4761,7 @@
- Index - - Schema public -
- -| F-Key | -Name | -Type | -Description | -
|---|---|---|---|
| - - - - | -pref_user | -text | -- - PRIMARY KEY - - - - - - - - - - | -
| - - | -pref_periode | -integer | -- - - NOT NULL - - - - | -
minimum attribut for the customer (frd_id=9)
-| - | tva_num | +quick_code | text |
@@ -4129,6 +5425,22 @@
|
+ |
+ tva_num |
+ text |
+
+
+
+
+
+
+
+ |
+
+
|
poste_comptable |
text |
@@ -4142,7 +5454,7 @@
|
@@ -4158,7 +5470,7 @@
|
@@ -4174,7 +5486,7 @@
|
@@ -4190,7 +5502,7 @@
|
@@ -4206,7 +5518,7 @@
|
@@ -4237,6 +5549,7 @@
SELECT a.f_id
, a.av_text AS name
+, a1.av_text AS quick_code
, b.av_text AS tva_num
, c.av_text AS poste_comptable
, d.av_text AS rue
@@ -4252,6 +5565,69 @@ FROM (
(
(
(
+ (
+ SELECT jnt_fic_att_value.jft_id
+ , fiche.f_id
+ , fiche_def.frd_id
+ , fiche.fd_id
+ , fiche_def.fd_class_base
+ , fiche_def.fd_label
+ , fiche_def.fd_create_account
+ , fiche_def_ref.frd_text
+ , fiche_def_ref.frd_class_base
+ , jnt_fic_att_value.ad_id
+ , attr_value.av_text
+ FROM (
+ (
+ (
+ (fiche
+ JOIN fiche_def
+ USING (fd_id)
+ )
+ JOIN fiche_def_ref
+ USING (frd_id)
+ )
+ JOIN jnt_fic_att_value
+ USING (f_id)
+ )
+ JOIN attr_value
+ USING (jft_id)
+ )
+ WHERE (jnt_fic_att_value.ad_id = 1)
+ ) a
+ JOIN (
+ SELECT jnt_fic_att_value.jft_id
+ , fiche.f_id
+ , fiche_def.frd_id
+ , fiche.fd_id
+ , fiche_def.fd_class_base
+ , fiche_def.fd_label
+ , fiche_def.fd_create_account
+ , fiche_def_ref.frd_text
+ , fiche_def_ref.frd_class_base
+ , jnt_fic_att_value.ad_id
+ , attr_value.av_text
+ FROM (
+ (
+ (
+ (fiche
+ JOIN fiche_def
+ USING (fd_id)
+ )
+ JOIN fiche_def_ref
+ USING (frd_id)
+ )
+ JOIN jnt_fic_att_value
+ USING (f_id)
+ )
+ JOIN attr_value
+ USING (jft_id)
+ )
+ WHERE (jnt_fic_att_value.ad_id = 13)
+ ) b
+ USING (f_id)
+ )
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4279,41 +5655,11 @@ FROM (
JOIN attr_value
USING (jft_id)
)
- WHERE (jnt_fic_att_value.ad_id = 1)
- ) a
- LEFT JOIN (
- SELECT jnt_fic_att_value.jft_id
- , fiche.f_id
- , fiche_def.frd_id
- , fiche.fd_id
- , fiche_def.fd_class_base
- , fiche_def.fd_label
- , fiche_def.fd_create_account
- , fiche_def_ref.frd_text
- , fiche_def_ref.frd_class_base
- , jnt_fic_att_value.ad_id
- , attr_value.av_text
- FROM (
- (
- (
- (fiche
- JOIN fiche_def
- USING (fd_id)
- )
- JOIN fiche_def_ref
- USING (frd_id)
- )
- JOIN jnt_fic_att_value
- USING (f_id)
- )
- JOIN attr_value
- USING (jft_id)
- )
- WHERE (jnt_fic_att_value.ad_id = 13)
- ) b
+ WHERE (jnt_fic_att_value.ad_id = 23)
+ ) a1
USING (f_id)
)
- LEFT JOIN (
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4345,7 +5691,7 @@ FROM (
) c
USING (f_id)
)
- LEFT JOIN (
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4377,7 +5723,7 @@ FROM (
) d
USING (f_id)
)
- LEFT JOIN (
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4409,7 +5755,7 @@ FROM (
) e
USING (f_id)
)
- LEFT JOIN (
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4441,7 +5787,7 @@ FROM (
) f
USING (f_id)
)
- LEFT JOIN (
+ JOIN (
SELECT jnt_fic_att_value.jft_id
, fiche.f_id
, fiche_def.frd_id
@@ -4711,6 +6057,22 @@ WHERE (a.frd_id = 9);
+ |
+ quick_code |
+ text |
+
+
+
+
+
+
+
+ |
+
+
|
frd_id |
integer |
@@ -4748,6 +6110,7 @@ SELECT a.f_id
, tva_rate.tva_label
, e.av_text AS vw_addr
, f.av_text AS vw_cp
+, j.av_text AS quick_code
, fiche_def.frd_id
FROM (
(
@@ -4757,23 +6120,45 @@ FROM (
(
(
(
- SELECT fiche.f_id
- , fiche.fd_id
- , attr_value.av_text
- FROM (
- (
- (fiche
- JOIN jnt_fic_att_value
- USING (f_id)
+ (
+ SELECT fiche.f_id
+ , fiche.fd_id
+ , attr_value.av_text
+ FROM (
+ (
+ (fiche
+ JOIN jnt_fic_att_value
+ USING (f_id)
+ )
+ JOIN attr_value
+ USING (jft_id)
)
- JOIN attr_value
- USING (jft_id)
+ JOIN attr_def
+ USING (ad_id)
)
- JOIN attr_def
- USING (ad_id)
+ WHERE (jnt_fic_att_value.ad_id = 1)
+ ) a
+ LEFT JOIN (
+ SELECT fiche.f_id
+ , attr_value.av_text
+ FROM (
+ (
+ (fiche
+ JOIN jnt_fic_att_value
+ USING (f_id)
+ )
+ JOIN attr_value
+ USING (jft_id)
+ )
+ JOIN attr_def
+ USING (ad_id)
+ )
+ WHERE (jnt_fic_att_value.ad_id = 6)
+ ) b
+ ON (
+ (a.f_id = b.f_id)
)
- WHERE (jnt_fic_att_value.ad_id = 1)
- ) a
+ )
LEFT JOIN (
SELECT fiche.f_id
, attr_value.av_text
@@ -4789,10 +6174,10 @@ FROM (
JOIN attr_def
USING (ad_id)
)
- WHERE (jnt_fic_att_value.ad_id = 6)
- ) b
+ WHERE (jnt_fic_att_value.ad_id = 7)
+ ) c
ON (
- (a.f_id = b.f_id)
+ (a.f_id = c.f_id)
)
)
LEFT JOIN (
@@ -4810,10 +6195,10 @@ FROM (
JOIN attr_def
USING (ad_id)
)
- WHERE (jnt_fic_att_value.ad_id = 7)
- ) c
+ WHERE (jnt_fic_att_value.ad_id = 2)
+ ) d
ON (
- (a.f_id = c.f_id)
+ (a.f_id = d.f_id)
)
)
LEFT JOIN (
@@ -4831,10 +6216,10 @@ FROM (
JOIN attr_def
USING (ad_id)
)
- WHERE (jnt_fic_att_value.ad_id = 2)
- ) d
+ WHERE (jnt_fic_att_value.ad_id = 14)
+ ) e
ON (
- (a.f_id = d.f_id)
+ (a.f_id = e.f_id)
)
)
LEFT JOIN (
@@ -4852,10 +6237,10 @@ FROM (
JOIN attr_def
USING (ad_id)
)
- WHERE (jnt_fic_att_value.ad_id = 14)
- ) e
+ WHERE (jnt_fic_att_value.ad_id = 15)
+ ) f
ON (
- (a.f_id = e.f_id)
+ (a.f_id = f.f_id)
)
)
LEFT JOIN (
@@ -4873,10 +6258,10 @@ FROM (
JOIN attr_def
USING (ad_id)
)
- WHERE (jnt_fic_att_value.ad_id = 15)
- ) f
+ WHERE (jnt_fic_att_value.ad_id = 23)
+ ) j
ON (
- (a.f_id = f.f_id)
+ (a.f_id = j.f_id)
)
)
LEFT JOIN tva_rate
@@ -4969,8 +6354,8 @@ FROM (
|
- fd_class_base |
- integer |
+ av_text |
+ text |
@@ -4984,6 +6369,22 @@ FROM (
|
+ |
+ fd_class_base |
+ poste_comptable |
+
+
+
+
+
+
+
+ |
+
+
|
fd_label |
text |
@@ -4997,7 +6398,7 @@ FROM (
|
@@ -5013,7 +6414,7 @@ FROM (
|
@@ -5045,14 +6446,29 @@ FROM (
SELECT jnt_fic_attr.fd_id
, jnt_fic_attr.ad_id
, attr_def.ad_text
+, attr_value.av_text
, fiche_def.fd_class_base
, fiche_def.fd_label
, fiche_def.fd_create_account
, fiche_def.frd_id
FROM (
- (jnt_fic_attr
+ (
+ (
+ (
+ (jnt_fic_att_value
+ JOIN attr_value
+ USING (jft_id)
+ )
+ JOIN fiche
+ USING (f_id)
+ )
+ JOIN jnt_fic_attr
+ USING (fd_id)
+ )
JOIN attr_def
- USING (ad_id)
+ ON (
+ (attr_def.ad_id = jnt_fic_attr.ad_id)
+ )
)
JOIN fiche_def
USING (fd_id)
@@ -5196,6 +6612,621 @@ FROM (
+ + Index - + Schema public + + ++ View: + vw_poste_qcode ++ + + +
+SELECT a.f_id +, a.av_text AS j_poste +, b.av_text AS j_qcode +FROM ( + ( + SELECT jnt_fic_att_value.f_id + , attr_value.av_text + FROM (attr_value + JOIN jnt_fic_att_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 5) + ) a + JOIN ( + SELECT jnt_fic_att_value.f_id + , attr_value.av_text + FROM (attr_value + JOIN jnt_fic_att_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 23) + ) b + USING (f_id) +);+ + + + + + + Index - + Schema public + + ++ View: + vw_supplier ++ + + +
+SELECT a.f_id +, a.av_text AS name +, a1.av_text AS quick_code +, b.av_text AS tva_num +, c.av_text AS poste_comptable +, d.av_text AS rue +, e.av_text AS code_postal +, f.av_text AS pays +, g.av_text AS telephone +, h.av_text AS email +FROM ( + ( + ( + ( + ( + ( + ( + ( + ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 1) + ) a + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 13) + ) b + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 23) + ) a1 + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 5) + ) c + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 14) + ) d + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 15) + ) e + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 16) + ) f + USING (f_id) + ) + JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 17) + ) g + USING (f_id) + ) +LEFT JOIN ( + SELECT jnt_fic_att_value.jft_id + , fiche.f_id + , fiche_def.frd_id + , fiche.fd_id + , fiche_def.fd_class_base + , fiche_def.fd_label + , fiche_def.fd_create_account + , fiche_def_ref.frd_text + , fiche_def_ref.frd_class_base + , jnt_fic_att_value.ad_id + , attr_value.av_text + FROM ( + ( + ( + (fiche + JOIN fiche_def + USING (fd_id) + ) + JOIN fiche_def_ref + USING (frd_id) + ) + JOIN jnt_fic_att_value + USING (f_id) + ) + JOIN attr_value + USING (jft_id) + ) + WHERE (jnt_fic_att_value.ad_id = 18) + ) h + USING (f_id) +) +WHERE (a.frd_id = 8);+ + + + + Index - Schema public @@ -5206,7 +7237,261 @@ FROM ( Function: - check_balance( p_internal text ) + account_add( p_id public.poste_comptable, p_name character varying ) ++Returns: void+Language: PLPGSQL+ ++declare + nParent tmp_pcmn.pcm_val_parent%type; + nCount integer; +begin + select count(*) into nCount from tmp_pcmn where pcm_val=p_id; + if nCount = 0 then + nParent=account_parent(p_id); + insert into tmp_pcmn (pcm_val,pcm_lib,pcm_val_parent) + values (p_id, p_name,nParent); + end if; +return; +end ; ++ + + Function: + account_auto( p_fd_id integer ) ++Returns: boolean+Language: PLPGSQL+ ++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; + end if; + return l_auto; +end; ++ + + Function: + account_compute( p_f_id integer ) ++Returns: poste_comptable+Language: PLPGSQL+ ++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; + if maxcode = class_base then + maxcode=class_base*1000+1; + end if; + raise notice 'Max code %',maxcode; +return maxcode+1; +end; ++ + + Function: + account_insert( p_f_id integer, p_account public.poste_comptable ) ++Returns: integer+Language: PLPGSQL+ ++declare +nParent tmp_pcmn.pcm_val_parent%type; +sName varchar; +nNew tmp_pcmn.pcm_val%type; +bAuto bool; +nFd_id integer; +nCount integer; +begin + + -- if p_value empty + if length(trim(p_account)) != 0 then + -- does the account exist ? + select * 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:=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 + 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 + nNew:=account_compute(p_f_id); +raise debug 'nNew %', nNew; + -- 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:=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; +end; ++ + + Function: + account_parent( p_account public.poste_comptable ) ++Returns: poste_comptable+Language: PLPGSQL+ ++declare + nParent tmp_pcmn.pcm_val_parent%type; + sParent varchar; + nCount integer; +begin + sParent:=to_char(p_account,'9999999999999999'); + sParent:=trim(sParent); + nParent:=0; + while nParent = 0 loop + select count(*) into nCount + from tmp_pcmn + where + pcm_val = to_number(sParent,'9999999999999999'); + if nCount != 0 then + nParent:=to_number(sParent,'9999999999999999'); + end if; + sParent:= substr(sParent,1,length(sParent)-1); + if length(sParent) <= 0 then + raise exception 'Impossible de trouver le compte parent pour %',p_account; + end if; + + end loop; + + return nParent; +end; ++ + + Function: + account_update( p_f_id integer, p_account public.poste_comptable ) ++Returns: integer+Language: PLPGSQL+ ++declare +nMax fiche.f_id%type; +nCount integer; +nParent tmp_pcmn.pcm_val_parent%type; +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; +end; ++ + + Function: + attribut_insert( p_f_id integer, p_ad_id integer, p_value character varying ) ++Returns: void+Language: PLPGSQL+ +
+declare
+ n_jft_id integer;
+begin
+ select nextval('s_jnt_fic_att_value') into n_jft_id;
+ insert into jnt_fic_att_value (jft_id,f_id,ad_id) values (n_jft_id,p_f_id,p_ad_id);
+ insert into attr_value (jft_id,av_text) values (n_jft_id,p_value);
+return;
+end;
+
+
+ + Function: + card_class_base( p_f_id integer ) ++Returns: poste_comptable+Language: PLPGSQL+ ++ +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) + 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; ++ + + Function: + check_balance( p_grpt integer )Returns: numericLanguage: PLPGSQL@@ -5218,21 +7503,21 @@ declare amount_jrn numeric; begin select sum (j_montant) into amount_jrnx_credit - from jrnx join jrn on (j_grpt=jr_grpt_id) + from jrnx where - jr_internal=p_internal + j_grpt=p_grpt and j_debit=false; select sum (j_montant) into amount_jrnx_debit - from jrnx join jrn on (j_grpt=jr_grpt_id) + from jrnx where - jr_internal=p_internal + j_grpt=p_grpt and j_debit=true; select jr_montant into amount_jrn from jrn where - jr_internal=p_internal; + jr_grpt_id=p_grpt; if ( amount_jrnx_debit != amount_jrnx_credit ) then @@ -5246,6 +7531,153 @@ begin end; ++ Function: + fiche_account_parent( p_f_id integer ) ++Returns: poste_comptable+Language: PLPGSQL+ ++declare +ret poste_comptable; +begin + select fd_class_base into ret from fiche_def join fiche using (fd_id) where f_id=p_f_id; + if not FOUND then + raise exception '% N''existe pas',p_f_id; + end if; + return ret; +end; ++ + + 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 ) ++Returns: void+Language: PLPGSQL+ ++declare + sCode varchar; + 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; + else + sCode=NULL; + end if; + + end if; + if p_montant = 0.0 then + return; + end if; + insert into jrnx + ( + j_date, + j_montant, + j_poste, + j_grpt, + j_jrn_def, + j_debit, + j_tech_user, + j_tech_per, + j_qcode + ) values + ( + to_date(p_date,'DD.MM.YYYY'), + p_montant, + p_poste, + p_grpt, + p_jrn_def, + p_debit, + p_tech_user, + p_tech_per, + sCode + ); + +return; +end; ++ + + 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 ) ++Returns: void+Language: PLPGSQL+ ++declare + fid_client integer; + 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; + + 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; + + + insert into quant_sold + (qs_internal,qs_fiche,qs_quantite,qs_price,qs_vat,qs_vat_code,qs_client) + values + (p_internal,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client); + return; +end; ++ + + Function: + insert_quick_code( nf_id integer, tav_text text ) ++Returns: integer+Language: PLPGSQL+ +
+ declare
+ ns integer;
+ nExist integer;
+ tText text;
+ begin
+ tText := upper(trim(tav_text));
+ 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;
+
+
Function:
plpgsql_validator( oid )
@@ -5265,19 +7697,252 @@ end;
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act = new action($cn) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | ag_id = $_POST['ag_id'] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | ag_id = $_POST['ag_id'] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | ag_comment = $_POST['ag_comment'] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | d_id = (isset($_POST['d_id']))?$_POST['d_id']:0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | ag_ref_ag_id = $_POST['ag_id'] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | ag_ref_ag_id = $_POST['ag_id'] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $act | f_id_dest = (isset($_POST['f_id_dest']))?$_POST['f_id_dest']:0 |
|
@@ -457,7 +457,7 @@ Referenced by action:
|
@@ -725,7 +725,7 @@ Definition at line 340<
|
@@ -770,7 +770,7 @@ Referenced by 240 of file action.inc.php.
@@ -851,7 +851,7 @@ Referenced by action:
Definition at line 241 of file action.inc.php.
-Referenced by ChangeStock(), action::Confirm(), widget::debug(), fiche_def_ref::Display(), DisplayDetailModele(), EncodeFiche(), EncodeForm(), Cezpdf::ezTable(), FormFin(), FormODS(), FormVenteView(), jrn::GetDefLine(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), fiche_def_ref::LoadAll(), make_array(), new_fiche(), Cpdf::o_fontDescriptor(), Document::ParseDocument(), RecordJrn(), action::SaveStage2(), ShowActionList(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), cl_user::update_global_pref(), UpdateJrn(), VerifImport(), ViewFiche(), ViewImp(), and widget::widget().
+Referenced by ChangeStock(), action::Confirm(), ConfirmTransfert(), widget::debug(), fiche_def_ref::Display(), DisplayDetailModele(), EncodeFiche(), EncodeForm(), Cezpdf::ezTable(), FormFin(), FormODS(), FormVenteView(), jrn::GetDefLine(), fiche::insert(), cl_user::insert_default_global_pref(), widget::IOValue(), jrn_navigation_bar(), fiche_def_ref::LoadAll(), make_array(), new_fiche(), Cpdf::o_fontDescriptor(), Document::ParseDocument(), RecordJrn(), action::SaveStage2(), ShowActionList(), ShowBox(), contact::Summary(), u_ShowMenuRecherche(), fiche::update(), cl_user::update_global_pref(), UpdateJrn(), ViewFiche(), ViewImp(), and widget::widget().
00001 <? +00002 /* +00003 * This file is part of PhpCompta. +00004 * +00005 * PhpCompta is free software; you can redistribute it and/or modify +00006 * it under the terms of the GNU General Public License as published by +00007 * the Free Software Foundation; either version 2 of the License, or +00008 * (at your option) any later version. +00009 * +00010 * PhpCompta is distributed in the hope that it will be useful, +00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of +00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +00013 * GNU General Public License for more details. +00014 * +00015 * You should have received a copy of the GNU General Public License +00016 * along with PhpCompta; if not, write to the Free Software +00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +00018 */ +00019 /* $Revision$ */ +00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr +00021 require_once("class_admin.php"); +00022 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:""; +00023 $User->AccessRequest($cn,ADMIN); +00024 +00029 ?> +00030 +00031 <? +00032 // Menu +00033 // Remove a card +00034 if ( isset ($_POST['delete']) ) +00035 { +00036 echo 'delete'; +00037 $f_id=$_REQUEST['f_id']; +00038 +00039 $fiche=new Admin($cn,$f_id); +00040 $fiche->remove(); +00041 $sub_action="list"; +00042 } +00043 //----------------------------------------------------- +00044 // Add card +00045 if ( $sub_action=="insert" ) +00046 { +00047 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>', +00048 urldecode($_REQUEST['url'])); +00049 +00050 $admin=new Admin($cn); +00051 $admin->Save($_REQUEST['fd_id']); +00052 echo $retour; +00053 echo "<table>"; +00054 echo $admin->Display(true); +00055 echo "</table>"; +00056 echo $retour; +00057 +00058 } +00059 //----------------------------------------------------- +00060 // Save modification +00061 if ( isset ($_POST['mod'])) +00062 { +00063 // modification is asked +00064 $f_id=$_REQUEST['f_id']; +00065 +00066 $sup=new Admin($cn,$f_id); +00067 $sup->Save(); +00068 } +00069 // by default open liste +00070 if ( $sub_action == "" ) +00071 $sub_action="list"; +00072 //----------------------------------------------------- +00073 //Display a blank card +00074 if ( $sub_action=="blank") +00075 { +00076 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>', +00077 "commercial.php?p_action=admin"); +00078 echo '<div class="u_redcontent">'; +00079 +00080 echo $retour; +00081 $c=new Admin($cn); +00082 echo '<form method="post" action="commercial.php"'; +00083 echo '<input type="hidden" name="p_action" value="admin">'; +00084 echo '<input type="hidden" name="sa" value="insert">'; +00085 echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">'; +00086 echo '<input type="hidden" name="url" value="'.$_GET['url'].'">'; +00087 echo $c->blank($_GET['fd_id']); +00088 echo '<input type="Submit" value="Sauve">'; +00089 echo '</form>'; +00090 echo $retour; +00091 echo '</div>'; +00092 } +00093 //----------------------------------------------------- +00094 // list +00095 if ( $sub_action == "list" ) +00096 { +00097 ?> +00098 <div class="u_content"> +00099 <span> +00100 <form method="get" action="commercial.php"> +00101 <? +00102 $a=(isset($_GET['query']))?$_GET['query']:""; +00103 printf ('<input type="text" name="query" value="%s">', +00104 $a); +00105 ?> +00106 <input type="submit" name="submit_query" value="recherche"> +00107 <input type="hidden" name="p_action" value="admin"> +00108 </form> +00109 </span> +00110 <span> +00111 <form method="get" action="commercial.php"> +00112 <input type="hidden" name="url" <? $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?> +00113 <input type="hidden" name="p_action" value="admin"> +00114 +00115 <? +00116 $w=new widget("select"); +00117 $w->name="fd_id"; +00118 $w->value= make_array($cn,"select fd_id,fd_label from fiche_def where ". +00119 " frd_id=".FICHE_TYPE_ADM_TAX); +00120 echo $w->IOValue(); +00121 ?> +00122 <input type="hidden" name="sa" value="blank"> +00123 <input type="submit" name="submit_query" value="Ajout Sup"> +00124 +00125 </form> +00126 </span> +00127 <? +00128 $sup=new Admin($cn); +00129 $search=(isset($_GET['query']))?$_GET['query']:""; +00130 // echo '<div style="position:absolute;left:15%;width:67%;margin-top:20px;">'; +00131 echo '<div class="u_redcontent">'; +00132 echo $sup->Summary($search); +00133 echo '</div>'; +00134 echo '</div>'; +00135 +00136 } +00137 //----------------------------------------------------- +00138 // Show Detail +00139 if ( $sub_action == 'detail' ) +00140 { +00141 $f_id=$_REQUEST['f_id']; +00142 echo '<div class="u_redcontent">'; +00143 $sup=new Admin($cn,$f_id); +00144 $retour=sprintf('<A class="two" HREF="%s"><input type="button" value="Retour"></A>', +00145 urldecode($_REQUEST['url'])); +00146 echo $retour; +00147 echo '<form action="'.$_REQUEST['url'].'" method="post">'; +00148 echo $sup->Display(false); +00149 $w=new widget("hidden"); +00150 $w->name="p_action"; +00151 $w->value="admin"; +00152 echo $w->IOValue(); +00153 $w->name="f_id"; +00154 $w->value=$f_id; +00155 echo $w->IOValue(); +00156 +00157 echo $w->Submit('mod','Sauver les modifications'); +00158 echo $w->Reset("Annuler"); +00159 echo $w->Submit('delete','Effacer cette fiche'); +00160 echo '</form>'; +00161 echo $retour; +00162 echo '<div>'; +00163 } +00164 html_page_stop(); +00165 ?> +
diff --git a/doc/developper/html/admin_8inc_8php-source.html b/doc/developper/html/admin_8inc_8php-source.html new file mode 100644 index 000000000..e4b62e890 --- /dev/null +++ b/doc/developper/html/admin_8inc_8php-source.html @@ -0,0 +1,172 @@ + +
+
+ +
+