Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions
install_impdol Class Reference
Collaboration diagram for install_impdol:
Collaboration graph

Public Member Functions

 install ($p_cn)
 

Detailed Description

Definition at line 28 of file class_install_impdol.php.

Member Function Documentation

install_impdol::install (   $p_cn)

Definition at line 31 of file class_install_impdol.php.

32  {
33  try
34  {
35  $p_cn->start();
36  $p_cn->exec_sql("create schema impdol");
37  $p_cn->exec_sql("
38  create table impdol.version (
39  v_id bigint primary key,
40  v_date date default now(),
41  v_text text
42  )
43  ");
44  $p_cn->exec_sql("insert into impdol.version(v_id,v_text) values ($1,$2)", array(1, "Installation"));
45 
46  $p_cn->exec_sql("
47  CREATE TABLE impdol.import
48  (
49  i_id serial NOT NULL,
50  temp_file text,
51  send_file text,
52  i_date timestamp with time zone DEFAULT now(),
53  i_row bigint,
54  CONSTRAINT import_pkey PRIMARY KEY (i_id )
55  )");
56 
57  $p_cn->exec_sql('
58  CREATE TABLE impdol.parameter_tva
59  (
60  pt_id serial NOT NULL,
61  tva_id bigint,
62  pt_rate numeric(20,4) DEFAULT 0,
63  CONSTRAINT parameter_tva_pkey PRIMARY KEY (pt_id )
64  )
65  ');
66  $p_cn->exec_sql("
67  CREATE TABLE impdol.operation_tmp
68  (
69  o_id bigserial NOT NULL,
70  o_doli text,
71  o_date text,
72  o_qcode text,
73  f_id text,
74  o_label text,
75  o_pj text,
76  amount_unit text,
77  amount_vat text,
78  number_unit text,
79  vat_rate text,
80  amount_total text,
81  jrn_def_id text,
82  o_message text,
83  i_id bigint,
84  o_result char,
85  tva_id bigint,
86  o_type char,
87  o_poste text,
88  CONSTRAINT operation_tmp_pkey PRIMARY KEY (o_id ),
89  CONSTRAINT operation_tmp_i_id_fkey FOREIGN KEY (i_id)
90  REFERENCES impdol.import (i_id) MATCH SIMPLE
91  ON UPDATE CASCADE ON DELETE CASCADE
92  )
93  ");
94 
95  $p_cn->exec_sql("
96  CREATE TABLE impdol.operation_transfer
97  (
98  ot_id serial NOT NULL,
99  j_id bigint,
100  o_id bigint,
101  CONSTRAINT operation_transfer_pkey PRIMARY KEY (ot_id ),
102  CONSTRAINT operation_transfer_j_id_fkey FOREIGN KEY (j_id)
103  REFERENCES jrnx (j_id) MATCH SIMPLE
104  ON UPDATE CASCADE ON DELETE CASCADE,
105  CONSTRAINT operation_transfer_o_id_fkey FOREIGN KEY (o_id)
106  REFERENCES impdol.operation_tmp (o_id) MATCH SIMPLE
107  ON UPDATE CASCADE ON DELETE CASCADE
108  )");
109 
110 
111 
112  $p_cn->exec_sql("
113  COMMENT ON COLUMN impdol.operation_tmp.o_result IS 'result is T can be transferrable, N cannot be transferrable';
114  ");
115 
116  $p_cn->exec_sql("
117  COMMENT ON COLUMN impdol.operation_tmp.o_type IS 'S = marchandise, serviceT = tiers (fournisseurs, client)'
118  ");
119  $p_cn->commit();
120  }
121  catch (Exception $e)
122  {
123  $p_cn->rollback();
124  print_r($e->getTraceAsString());
125  }
126  }

The documentation for this class was generated from the following file: