-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodelo.dbm
527 lines (490 loc) · 20.9 KB
/
modelo.dbm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<?xml version="1.0" encoding="UTF-8"?>
<!--
CAUTION: Do not modify this file unless you know what you are doing.
Unexpected results may occur if the code is changed deliberately.
-->
<dbmodel pgmodeler-ver="0.9.3" use-changelog="false" last-position="0,0" last-zoom="0.85" max-obj-count="10"
default-schema="public" default-owner="postgres">
<database name="postgres" encoding="UTF8" lc-collate="en_US.UTF-8" lc-ctype="en_US.UTF-8" is-template="false" allow-conns="true">
<role name="postgres"/>
<tablespace name="pg_default"/>
<comment><![CDATA[default administrative connection database]]></comment>
</database>
<schema name="public" layer="0" rect-visible="true" fill-color="#e1e1e1" sql-disabled="true">
</schema>
<schema name="acta_recibido" layer="0" rect-visible="true" fill-color="#62a0ea">
<role name="postgres"/>
<comment><![CDATA[Esquema para la gestión de actas de recibido]]></comment>
</schema>
<sequence name="acta_recibido_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="acta_recibido" layer="0" collapse-mode="2" max-obj-count="6" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<comment><![CDATA[tabla para guardar informacion del acta recibido]]></comment>
<position x="720" y="500"/>
<column name="id" not-null="true" sequence="acta_recibido.acta_recibido_id_seq">
<type name="integer" length="0"/>
<comment><![CDATA[campo para guardar identificador del acta recibido]]></comment>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="tipo_acta_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="pk_acta_recibido" type="pk-constr" table="acta_recibido.acta_recibido">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="elemento_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="elemento" layer="0" collapse-mode="2" max-obj-count="25" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<comment><![CDATA[tabla para guardar los elementos de acta recibido por contrato]]></comment>
<position x="1280" y="300"/>
<column name="id" not-null="true" sequence="acta_recibido.elemento_id_seq">
<type name="integer" length="0"/>
<comment><![CDATA[identificador para acta recibido elemento por contratos]]></comment>
</column>
<column name="nombre" not-null="true">
<type name="text" length="0"/>
<comment><![CDATA[campo para guardar elemento acta recibido]]></comment>
</column>
<column name="cantidad" not-null="true">
<type name="integer" length="0"/>
<comment><![CDATA[campo para cantidad de elemento acta]]></comment>
</column>
<column name="marca">
<type name="character varying" length="50"/>
<comment><![CDATA[campo para guardar marca del elemento acta recibido]]></comment>
</column>
<column name="serie">
<type name="character varying" length="100"/>
<comment><![CDATA[campo para guardar serie elemento acta recibido]]></comment>
</column>
<column name="unidad_medida" not-null="true">
<type name="integer" length="0"/>
<comment><![CDATA[campo para guardar el tipo de unidad del elemento acta recibido, se consume a través de Agora]]></comment>
</column>
<column name="valor_unitario" not-null="true">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[campo que hace referencia al valor del elemento po unidad]]></comment>
</column>
<column name="subtotal">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[Elemento que hace referencia al valor unitario por la cantidad de elementos del mismo ejemplar en el acta
]]></comment>
</column>
<column name="descuento">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[Hace referencia al valor de descuento del subtotal
]]></comment>
</column>
<column name="valor_total">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[Hace referencia al valor despues de descuento al que se le toman impuestos]]></comment>
</column>
<column name="porcentaje_iva_id" not-null="true">
<type name="integer" length="0"/>
<comment><![CDATA[Hace referencia al porcentaje de impuesto IVA del valor despues de descuento]]></comment>
</column>
<column name="valor_iva">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[Hace referencia al valor de IVA tomado despues de restar los descuentos]]></comment>
</column>
<column name="valor_final">
<type name="numeric" length="20" precision="7"/>
<comment><![CDATA[Hace referencia al valor final despues de descuentos e impuestos del elemento ]]></comment>
</column>
<column name="subgrupo_catalogo_id">
<type name="integer" length="0"/>
<comment><![CDATA[foranea para relacionar subgrupo de inventarios con tabla de rompimiento contrato elemento y acta recibido]]></comment>
</column>
<column name="estado_elemento_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="placa">
<type name="character varying" length="100"/>
<comment><![CDATA[Hace referencia a la placa del elemento para uso futuro en el modulo de salidas]]></comment>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="espacio_fisico_id">
<type name="integer" length="0"/>
<comment><![CDATA[Hace referencia al id en la tabla espacio_físico en el api oikos_crud, en caso de que el elemento sea de tipo bien inmueble]]></comment>
</column>
<column name="acta_recibido_id" not-null="true">
<type name="integer" length="0"/>
</column>
<constraint name="pk_elemento" type="pk-constr" table="acta_recibido.elemento">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="estado_acta_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="estado_acta" layer="0" collapse-mode="2" max-obj-count="9" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<comment><![CDATA[tabla para almacenar los estados de acta recibido]]></comment>
<position x="20" y="480"/>
<column name="id" not-null="true" sequence="acta_recibido.estado_acta_id_seq">
<type name="integer" length="0"/>
<comment><![CDATA[campo serial para estado acta recibido]]></comment>
</column>
<column name="nombre" not-null="true">
<type name="character varying" length="20"/>
<comment><![CDATA[campo para almacenar campo nombre estado]]></comment>
</column>
<column name="descripcion">
<type name="character varying" length="250"/>
<comment><![CDATA[campo para almacenar descripcion estado]]></comment>
</column>
<column name="codigo_abreviacion">
<type name="character varying" length="20"/>
<comment><![CDATA[campo que indica la abreviaicion de estado acta recibido]]></comment>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
<comment><![CDATA[campo que indica el estado para estado acta]]></comment>
</column>
<column name="numero_orden">
<type name="numeric" length="5" precision="2"/>
<comment><![CDATA[campo que indica el orden en ser mostrado el estado acta recibido]]></comment>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<constraint name="pk_estado_acta" type="pk-constr" factor="100" table="acta_recibido.estado_acta">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="estado_elemento_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="estado_elemento" layer="0" collapse-mode="2" max-obj-count="9" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<position x="1900" y="760"/>
<column name="id" not-null="true" sequence="acta_recibido.estado_elemento_id_seq">
<type name="integer" length="0"/>
</column>
<column name="nombre" not-null="true">
<type name="character varying" length="20"/>
</column>
<column name="descripcion">
<type name="character varying" length="250"/>
</column>
<column name="codigo_abreviacion">
<type name="character varying" length="20"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="numero_orden">
<type name="numeric" length="5" precision="2"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<constraint name="pk_estado_elemento" type="pk-constr" table="acta_recibido.estado_elemento">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="soporte_acta_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="soporte_acta" layer="0" collapse-mode="2" max-obj-count="9" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<position x="280" y="740"/>
<column name="id" not-null="true" sequence="acta_recibido.soporte_acta_id_seq">
<type name="integer" length="0"/>
</column>
<column name="consecutivo">
<type name="character varying" length="100"/>
<comment><![CDATA[Hace referencia al numero de factura o soporte que debe ser de caracter unico]]></comment>
</column>
<column name="fecha_soporte">
<type name="date" length="0"/>
<comment><![CDATA[hace referencia a la fecha de creacion o expedicion de la factura o soporte del acta de recibido]]></comment>
</column>
<column name="acta_recibido_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="documento_id">
<type name="integer" length="0"/>
</column>
<constraint name="pk_soporte_acta" type="pk-constr" table="acta_recibido.soporte_acta">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="historico_acta_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="historico_acta" layer="0" collapse-mode="2" max-obj-count="14" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<comment><![CDATA[tabla de rompimiento para la relacion de los estados del acta y el acta de recibido ]]></comment>
<position x="260" y="40"/>
<column name="id" not-null="true" sequence="acta_recibido.historico_acta_id_seq">
<type name="integer" length="0"/>
</column>
<column name="acta_recibido_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="estado_acta_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="proveedor_id">
<type name="integer" length="0"/>
</column>
<column name="ubicacion_id">
<type name="integer" length="0"/>
</column>
<column name="revisor_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="persona_asignada_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="observaciones">
<type name="text" length="0"/>
</column>
<column name="fecha_visto_bueno">
<type name="date" length="0"/>
</column>
<constraint name="pk_historico_acta" type="pk-constr" table="acta_recibido.historico_acta">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="tipo_acta_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="tipo_acta" layer="0" collapse-mode="2" max-obj-count="8" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<position x="720" y="80"/>
<column name="id" not-null="true" sequence="acta_recibido.tipo_acta_id_seq">
<type name="integer" length="0"/>
</column>
<column name="nombre" not-null="true">
<type name="character varying" length="20"/>
</column>
<column name="descripcion">
<type name="character varying" length="250"/>
</column>
<column name="codigo_abreviacion">
<type name="character varying" length="20"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp" length="0"/>
</column>
<constraint name="pk_tipo_acta" type="pk-constr" table="acta_recibido.tipo_acta">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="elemento_campo_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="elemento_campo" layer="0" collapse-mode="2" max-obj-count="8" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<position x="1900" y="420"/>
<column name="id" not-null="true" sequence="acta_recibido.elemento_campo_id_seq">
<type name="integer" length="0"/>
</column>
<column name="elemento_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="campo_id" not-null="true">
<type name="integer" length="0"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp with time zone" length="0" with-timezone="true"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp with time zone" length="0" with-timezone="true"/>
</column>
<column name="valor">
<type name="jsonb" length="0"/>
</column>
<constraint name="pk_elemento_campo" type="pk-constr" table="acta_recibido.elemento_campo">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<sequence name="campo_id_seq" cycle="false" start="1" increment="1" min-value="1" max-value="2147483647" cache="1">
<schema name="acta_recibido"/>
<role name="postgres"/>
</sequence>
<table name="campo" layer="0" collapse-mode="2" max-obj-count="9" z-value="0">
<schema name="acta_recibido"/>
<role name="postgres"/>
<position x="1900" y="80"/>
<column name="id" not-null="true" sequence="acta_recibido.campo_id_seq">
<type name="integer" length="0"/>
</column>
<column name="nombre">
<type name="character varying" length="20"/>
</column>
<column name="sigla">
<type name="character varying" length="10"/>
</column>
<column name="descripcion">
<type name="character varying" length="100"/>
</column>
<column name="activo" not-null="true">
<type name="boolean" length="0"/>
</column>
<column name="fecha_creacion" not-null="true">
<type name="timestamp with time zone" length="0" with-timezone="true"/>
</column>
<column name="fecha_modificacion" not-null="true">
<type name="timestamp with time zone" length="0" with-timezone="true"/>
</column>
<column name="metadato">
<type name="jsonb" length="0"/>
</column>
<constraint name="pk_campo" type="pk-constr" table="acta_recibido.campo">
<columns names="id" ref-type="src-columns"/>
</constraint>
</table>
<constraint name="fk_acta_recibido_tipo_acta" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.tipo_acta" table="acta_recibido.acta_recibido">
<columns names="tipo_acta_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_elemento_estado_elemento" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.estado_elemento" table="acta_recibido.elemento">
<columns names="estado_elemento_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_elemento_acta_recibido" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.acta_recibido" table="acta_recibido.elemento">
<columns names="acta_recibido_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_soporte_acta_acta_recibido" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.acta_recibido" table="acta_recibido.soporte_acta">
<columns names="acta_recibido_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_acta_recibido" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.acta_recibido" table="acta_recibido.historico_acta">
<columns names="acta_recibido_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_estado_acta" type="fk-constr" comparison-type="MATCH FULL"
upd-action="CASCADE" del-action="RESTRICT" ref-table="acta_recibido.estado_acta" table="acta_recibido.historico_acta">
<columns names="estado_acta_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_elemento_campo_elemento" type="fk-constr" comparison-type="MATCH FULL"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="acta_recibido.elemento" table="acta_recibido.elemento_campo">
<columns names="elemento_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<constraint name="fk_elemento_campo_campo" type="fk-constr" comparison-type="MATCH FULL"
upd-action="NO ACTION" del-action="NO ACTION" ref-table="acta_recibido.campo" table="acta_recibido.elemento_campo">
<columns names="campo_id" ref-type="src-columns"/>
<columns names="id" ref-type="dst-columns"/>
</constraint>
<relationship name="rel_acta_recibido_tipo_acta" type="relfk" layer="0"
custom-color="#c48be8"
src-table="acta_recibido.acta_recibido"
dst-table="acta_recibido.tipo_acta" reference-fk="fk_acta_recibido_tipo_acta"
src-required="false" dst-required="true"/>
<relationship name="rel_elemento_estado_elemento" type="relfk" layer="0"
custom-color="#6d7b80"
src-table="acta_recibido.elemento"
dst-table="acta_recibido.estado_elemento" reference-fk="fk_elemento_estado_elemento"
src-required="false" dst-required="true"/>
<relationship name="rel_elemento_acta_recibido" type="relfk" layer="0"
custom-color="#421bc6"
src-table="acta_recibido.elemento"
dst-table="acta_recibido.acta_recibido" reference-fk="fk_elemento_acta_recibido"
src-required="false" dst-required="true"/>
<relationship name="rel_soporte_acta_acta_recibido" type="relfk" layer="0"
custom-color="#181ea9"
src-table="acta_recibido.soporte_acta"
dst-table="acta_recibido.acta_recibido" reference-fk="fk_soporte_acta_acta_recibido"
src-required="false" dst-required="true"/>
<relationship name="rel_historico_acta_acta_recibido" type="relfk" layer="0"
custom-color="#d04f3d"
src-table="acta_recibido.historico_acta"
dst-table="acta_recibido.acta_recibido" reference-fk="fk_acta_recibido"
src-required="false" dst-required="true"/>
<relationship name="rel_historico_acta_estado_acta" type="relfk" layer="0"
custom-color="#eca9ed"
src-table="acta_recibido.historico_acta"
dst-table="acta_recibido.estado_acta" reference-fk="fk_estado_acta"
src-required="false" dst-required="true"/>
<relationship name="rel_elemento_campo_elemento" type="relfk" layer="0"
custom-color="#cb4e15"
src-table="acta_recibido.elemento_campo"
dst-table="acta_recibido.elemento" reference-fk="fk_elemento_campo_elemento"
src-required="false" dst-required="true"/>
<relationship name="rel_elemento_campo_campo" type="relfk" layer="0"
custom-color="#87ac07"
src-table="acta_recibido.elemento_campo"
dst-table="acta_recibido.campo" reference-fk="fk_elemento_campo_campo"
src-required="false" dst-required="true"/>
</dbmodel>