-- Name: valstock(integer, integer); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION valstock(integer, integer) RETURNS numeric
    LANGUAGE plpgsql
    AS $_$
DECLARE
    operacioni	ALIAS FOR $1; 	-- Operacion de ingreso
    operacione	ALIAS FOR $2; 	-- Operacion de egreso
    registro 	RECORD;
    registror 	RECORD;
    retirado	numeric;
    cantret		numeric;
    precio		numeric;
    retval 		numeric;
BEGIN

    retval:=0;
    for registror in select *
        from subitem where sitem_idoper=operacioni
	    loop
		retval:=retval+registror.sitem_imp_dolar;

		if(numeric_ne(registror.sitem_canting,0) and numeric_ne(registror.sitem_imp_dolar,0)) then
			precio:=registror.sitem_imp_dolar/registror.sitem_canting;
		    end if;

		if(registror.sitem_cantret is not null and registror.sitem_cantret!=0) then

		    select sum(ret_cantidad) into cantret from retiros where registror.sitem_id=ret_idsitem and ret_idopera=operacione;
		    if not found then 
			    retirado:=0;
			else
			    retirado:=cantret*precio;
		    end if;
		    if(retirado is not null and retirado!=0) then   retval:=retval-retirado; end if;
		end if;
	    end loop; 
retval:=retval::numeric(15,2);

RETURN retval;
END;$_$;


ALTER FUNCTION public.valstock(integer, integer) OWNER TO zona;

--
-- Name: valtari(integer, integer, numeric, smallint, date); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION valtari(integer, integer, numeric, smallint, date) RETURNS numeric
    LANGUAGE plpgsql
    AS $_$
declare
usuario		 alias for $1;
articulo	 alias for $2;
canti		 alias for $3;
dias		 alias for $4;
fecha		 alias for $5;
ret 		 numeric;
paso 		 numeric;
paso5 		 numeric;
registro	 record;
regi		 record;
hay	 	 int4;
articulo5 	 int4;
coti 	 	 numeric;
importe 	 numeric;
begin

    for registro in select 
	    * from tarifas where tari_imp_dolar!=0 and tari_usuario=usuario and tari_idart=articulo and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) limit 1
	loop
	    if numeric_ne(canti,0::numeric) then
		if (registro.tari_cdesde is not null and registro.tari_chasta is not null and numeric_ge(registro.tari_chasta,canti) and numeric_le(registro.tari_cdesde,canti)) then
			paso=1;
		    else
			paso=0;
		end if;
	    end if; 

	    if int2ne(dias,0::int2) then
		if (registro.tari_ddesde is not null and registro.tari_dhasta is not null and int2ge(registro.tari_dhasta,dias) and int2le(registro.tari_ddesde,dias)) then
			paso=1;
		    else
			paso=0;
		end if;
	    end if; 

	    if paso is null then 
		paso=1; 
	    end if;

	    importe=registro.tari_imp_dolar;
	    select cot_cotiz into coti from cotiza where cot_moneda=1 order by cot_fecha desc limit 1;

	    if numeric_ge(coti,registro.tari_cot_dolar) then
		    ret= importe * coti * paso;
		else
		    ret= importe * registro.tari_cot_dolar * paso;
	    end if;
	end loop; 


    if ret is null then
    if int4ge(articulo,27) then
    if int4le(articulo,31) then
	articulo5=articulo - 5;
	for regi in select 
	    * from tarifas where tari_imp_dolar!=0 and tari_usuario=usuario and tari_idart=articulo5 and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) limit 1
	    loop
		if numeric_ne(canti,0::numeric) then
		    if (regi.tari_cdesde is not null and regi.tari_chasta is not null and numeric_ge(regi.tari_chasta,canti) and numeric_le(regi.tari_cdesde,canti)) then
			paso5=1;
		      else
			paso5=0;
		    end if;
		end if; 

		if int2ne(dias,0::int2) then
		    if (regi.tari_ddesde is not null and regi.tari_dhasta is not null and int2ge(regi.tari_dhasta,dias) and int2le(regi.tari_ddesde,dias)) then
			paso5=1;
		      else
			paso5=0;
		    end if;
		end if; 

		if paso5 is null then 
		    paso5=1; 
		end if;

		importe=regi.tari_imp_dolar;
		select cot_cotiz into coti from cotiza where cot_moneda=1 order by cot_fecha desc limit 1;

		if numeric_ge(coti,regi.tari_cot_dolar) then
		    ret= importe * coti * paso5;
		  else
		    ret= importe * regi.tari_cot_dolar * paso5;
		end if;
	    end loop; 
    end if;
    end if;
    end if;




	if ret is null then
	    select tari_importe into ret from tarifas where tari_usuario=usuario and tari_idart=articulo and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) limit 1;
	end if;

    if ret is null then
    if int4ge(articulo,27) then
    if int4le(articulo,31) then
	articulo5=articulo - 5;
	    select tari_importe into ret from tarifas where tari_usuario=usuario and tari_idart=articulo5 and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) limit 1;
    end if;
    end if;
    end if;


	if ret is null then
	    if int4eq(articulo,50) then ret=20;
		else
		    if int4eq(articulo,35) then ret=1260;
			else
			    if int4eq(articulo,40) then ret=945;
				else
				    ret=0; 
			    end if;
		    end if;
	    end if;
	end if;


return ret;
end;$_$;


ALTER FUNCTION public.valtari(integer, integer, numeric, smallint, date) OWNER TO zona;

--
-- Name: valtarico(integer, integer, numeric, smallint, date, integer, smallint); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION valtarico(integer, integer, numeric, smallint, date, integer, smallint) RETURNS numeric
    LANGUAGE plpgsql
    AS $_$
declare
usuario		 alias for $1;
articulo	 alias for $2;
canti		 alias for $3;
dias		 alias for $4;
fecha		 alias for $5;
contrato	 alias for $6;
orden		 alias for $7;
ret 		 numeric;
paso 		 numeric;
paso5 		 numeric;
registro	 record;
regi		 record;
hay	 	 int4;
articulo5 	 int4;
coti 	 	 numeric;
importe 	 numeric;
begin

    for registro in select 
	    * from tarifas where tari_imp_dolar!=0 and tari_usuario=usuario and tari_idart=articulo and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) and tari_idcontr=contrato and tari_orden=orden limit 1
	loop
	    if numeric_ne(canti,0::numeric) then
		if (registro.tari_cdesde is not null and registro.tari_chasta is not null and numeric_ge(registro.tari_chasta,canti) and numeric_le(registro.tari_cdesde,canti)) then
			paso=1;
		    else
			paso=0;
		end if;
	    end if; 

	    if int2ne(dias,0::int2) then
		if (registro.tari_ddesde is not null and registro.tari_dhasta is not null and int2ge(registro.tari_dhasta,dias) and int2le(registro.tari_ddesde,dias)) then
			paso=1;
		    else
			paso=0;
		end if;
	    end if; 

	    if paso is null then 
		paso=1; 
	    end if;

	    importe=registro.tari_imp_dolar;
	    select cot_cotiz into coti from cotiza where cot_moneda=1 order by cot_fecha desc limit 1;

	    if numeric_ge(coti,registro.tari_cot_dolar) then
		    ret= importe * coti * paso;
		else
		    ret= importe * registro.tari_cot_dolar * paso;
	    end if;
	end loop; 


    if ret is null then
    if int4ge(articulo,27) then
    if int4le(articulo,31) then
	articulo5=articulo - 5;
	for regi in select 
	    * from tarifas where tari_imp_dolar!=0 and tari_usuario=usuario and tari_idart=articulo5 and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) and tari_idcontr=contrato and tari_orden=orden limit 1
	    loop
		if numeric_ne(canti,0::numeric) then
		    if (regi.tari_cdesde is not null and regi.tari_chasta is not null and numeric_ge(regi.tari_chasta,canti) and numeric_le(regi.tari_cdesde,canti)) then
			paso5=1;
		      else
			paso5=0;
		    end if;
		end if; 

		if int2ne(dias,0::int2) then
		    if (regi.tari_ddesde is not null and regi.tari_dhasta is not null and int2ge(regi.tari_dhasta,dias) and int2le(regi.tari_ddesde,dias)) then
			paso5=1;
		      else
			paso5=0;
		    end if;
		end if; 

		if paso5 is null then 
		    paso5=1; 
		end if;

		importe=regi.tari_imp_dolar;
		select cot_cotiz into coti from cotiza where cot_moneda=1 order by cot_fecha desc limit 1;

		if numeric_ge(coti,regi.tari_cot_dolar) then
		    ret= importe * coti * paso5;
		  else
		    ret= importe * regi.tari_cot_dolar * paso5;
		end if;
	    end loop; 
    end if;
    end if;
    end if;




	if ret is null then
	    select tari_importe into ret from tarifas where tari_usuario=usuario and tari_idart=articulo and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) and tari_idcontr=contrato and tari_orden=orden limit 1;
	end if;

    if ret is null then
    if int4ge(articulo,27) then
    if int4le(articulo,31) then
	articulo5=articulo - 5;
	    select tari_importe into ret from tarifas where tari_usuario=usuario and tari_idart=articulo5 and 
	    date_ge(tari_fhasta,fecha) and date_le(tari_fdesde,fecha) and tari_idcontr=contrato and tari_orden=orden limit 1;
    end if;
    end if;
    end if;


	if ret is null then
	    if int4eq(articulo,50) then ret=20;
		else
		    if int4eq(articulo,35) then ret=1260;
			else
			    if int4eq(articulo,40) then ret=945;
				else
				    ret=0;
			    end if;
		    end if;
	    end if;
	end if;


return ret;
end;$_$;


ALTER FUNCTION public.valtarico(integer, integer, numeric, smallint, date, integer, smallint) OWNER TO zona;

--
-- Name: valvaramb(integer, integer, character varying); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION valvaramb(integer, integer, character varying) RETURNS character
    LANGUAGE plpgsql
    AS $_$
    DECLARE
	codemp		ALIAS FOR $1; 
	ptovta		ALIAS FOR $2; 
	codigo		ALIAS FOR $3; 
	otro 		integer;
	retval 		varchar;
    BEGIN

    select vari_valor into retval from
    	 varambi where int4eq(ptovta,vari_idptov) and int4eq(codemp,vari_codemp) and bpchareq(codigo,vari_codigo);

    if not found then
	select vari_valor into retval from
    	    varambi where int4eq(0,vari_idptov) and int4eq(codemp,vari_codemp) and bpchareq(codigo,vari_codigo);
	if not found then
	    select vari_valor into retval from
    		varambi where int4eq(0,vari_idptov) and int4eq(0,vari_codemp) and bpchareq(codigo,vari_codigo);
	end if;
    end if;
    RETURN retval;
    END;$_$;


ALTER FUNCTION public.valvaramb(integer, integer, character varying) OWNER TO zona;

--
-- Name: veo_seg_disponible(integer); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION veo_seg_disponible(integer) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
    DECLARE
	operacion	ALIAS FOR $1; -- Operacion
 
	compara 	numeric;
	totals		numeric;
	aux_seg 	varchar;
	importe 	numeric;
	deposito	int2;
	retval 		boolean;

    BEGIN

	SELECT  var_valor  INTO     aux_seg 	
		    FROM varamb    WHERE var_codigo like 'SEGURO%';
	retval:='f';
	    
	if bpchareq(aux_seg,'NO') then
	    select op_deposito,op_impdolar into deposito,importe from operaciones where op_id=operacion;
	    select sum((sitem_canting-sitem_cantret-sitem_cantmala)*(sitem_imp_dolar/sitem_canting)) into totals from subitem where sitem_estado=1 and sitem_deposito=deposito and estadop(sitem_idoper)=101;
	    SELECT  unif_seguro - totals INTO compara FROM unifun WHERE unif_codigo = deposito;
	    if numeric_le(importe,compara) then
		retval:='t';
	      else
		retval:='f';
	    end if;

	  else
	    retval='t';

	end if;

    RETURN retval;
    END;$_$;


ALTER FUNCTION public.veo_seg_disponible(integer) OWNER TO zona;

--
-- Name: verif_estado(integer, smallint, smallint); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION verif_estado(integer, smallint, smallint) RETURNS boolean
    LANGUAGE plpgsql
    AS $_$
    DECLARE
	operacion	ALIAS FOR $1; 	-- operacion
	estado		ALIAS FOR $2; 	-- estado
	modo		ALIAS FOR $3; 	-- 1 cambia estado
					-- Solo verifica sin cambiar estado 
	viejo_estado	int2;
	directo		int4;
	tipoper		int4;
	indirecto	int4;
	consig		int4;
	duedepo		int4;
	nrotalzon	int4;
	nrotaldir	int4;
	deposito	int2;
	importe		numeric;
	aux_texto 	text;
	aux_motivo 	text;
	mal		int2;
	trans 		boolean;
	trans1 		boolean;
	notid		int4;
	fobopera	numeric;
	foboperai	numeric;
	ret		boolean;
	registro	RECORD;
    BEGIN

select 	op_estado,op_tipoper,op_directo,op_indirecto,op_nrotalzon,op_nrotaldir,op_deposito,op_importe,op_consig
into viejo_estado,tipoper,directo,indirecto,nrotalzon,nrotaldir,deposito,importe,consig
	    from operaciones where op_id=operacion;

select unif_usuario into duedepo from unifun where unif_codigo=deposito;

if consig is null then
    consig:=-1;
end if;

------------------- I N G R E S O S


if(int4lt(tipoper,100::int2))  THEN 



------------------- PUBLICACION 
--falta ver los contratos por unidad funcional que salen de subitem

    if(( int2eq(estado,101::int2)and int2eq(viejo_estado,1::int2) )
	or 
	(int2eq(estado,102::int2)and int2eq(viejo_estado,101::int2) )
	or 
	(int2eq(estado,1::int2)and int2eq(viejo_estado,11::int2) )
		or
	(int2eq(estado,101::int2)and int2eq(viejo_estado,11::int2) )
		or
	(int2eq(estado,1::int2) and int2eq(viejo_estado,1::int2))) THEN 

	    delete from noticias where not_tipo=1 and not_numero=operacion;

	    if(int4eq(tipoper,10::int2) or int4eq(tipoper,30::int2))  THEN 
		foboperai:=fob_hijos1(operacion,2::int2);
		update operaciones set op_importe=foboperai,op_impdolar=foboperai WHERE op_id = operacion;
	    END IF;

	    if (hay_cont_valido(directo,indirecto,4::int2)!=true )THEN 
	    aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' no existe contrato entre el directo '||directo||'  ('||nomusu(directo) ||')     y el indirecto '||indirecto||'  ('||nomusu(indirecto)||')';
	    insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    if (numeric_ne(fobpadre_vs_fobhijos(operacion,1::int2),0)) THEN 
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el valor FOB de los SUBITEMS es distinto al FOB de la operacion, debera modificar este error antes de oficializar';
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    if (seg_disponible(deposito, importe,1::int2)!=true) THEN 
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el deposito '||deposito||'  ('||traigo_nomunifun(deposito::int2)||') no tiene el seguro necesario';
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    trans1:=tipprod_ok(operacion,1::int2,2::int2);

	    if (int4ne(duedepo,directo)) THEN
		trans1:=hay_contrato(duedepo,directo,5::int2,operacion,5::int2);
	    END IF;
	    
	    if(tipoper=5 and consig=-1) then
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' no se ha definifo el consignatario';
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;


	    for registro in select itemdeitem(sitem_iditem) as item, sitem_codigo  from subitem where sitem_idoper=operacion and estadunif(sitem_deposito)=999 
		loop
		    select inh_motivo into aux_motivo from inhabilit where inh_deposito=registro.sitem_deposito order by inh_cont desc limit 1;
		    aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el Item '||registro.item ||' Subitem '||registro.sitem_codigo||' Se encuentra en un deposito INHABILITADO '||aux_motivo;
		    insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
		end loop; 

	END IF;
	
    else

------------------- E G R E S O S
------------------- PUBLICACION 
        if ((int2eq(estado,101::int2) and int2eq(viejo_estado,1::int2)) 
		or 
    	    (int2eq(estado,102::int2) and int2eq(viejo_estado,101::int2))
		or 
	    (int2eq(estado,1::int2) and int2eq(viejo_estado,11::int2))
		or
	    (int2eq(estado,101::int2)and int2eq(viejo_estado,11::int2))
		or
	    (int2eq(estado,1::int2) and int2eq(viejo_estado,1::int2))) THEN 

	    delete from noticias where not_tipo=1 and not_numero=operacion;

	    if (hay_cont_valido(directo,indirecto,4::int2)!=true )THEN 
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' no existe contrato entre el directo '||directo||'  ('||nomusu(directo) ||')     y el indirecto '||indirecto||'  ('||nomusu(indirecto)||')';
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    if ctacte_ok(directo)!=true THEN 
		select inh_motivo into aux_motivo from inhabilit where inh_usuario=directo order by inh_cont desc limit 1;
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el usuario directo '||directo||'  ('||nomusu(directo) ||')  esta inhabilitado por '||aux_motivo;
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    if ctacte_ok(indirecto)!=true THEN 
		select inh_motivo into aux_motivo from inhabilit where inh_usuario=directo order by inh_cont desc limit 1;
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el usuario indirecto '||indirecto||'  ('||nomusu(indirecto) ||')  esta inhabilitado por '||aux_motivo;
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;
	    
	    if(tipoper=105 and consig=-1) then
		aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' no se ha definifo el consignatario';
		insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
	    END IF;

	    fobopera:=fob_hijos2(operacion,2::int2);

	    for registro in select itemitemdesitem(ret_idsitem) as item, sitemcodigo(ret_idsitem) as sitem_codigo from retiros where ret_idopera=operacion and estadunif(depositem(ret_idsitem))=999 
		loop
		    select inh_motivo into aux_motivo from inhabilit where inh_deposito=registro.sitem_deposito order by inh_cont desc limit 1;
		    aux_texto:='En la Operacion '||traigo_simbtipoper(tipoper)||' '||nrotaldir||' el Item '||registro.item ||' Subitem '||registro.sitem_codigo||' Se encuentra en un deposito INHABILITADO '||aux_motivo;
		    insert into noticias(not_tipo,not_numero,not_texto)values(1,operacion,aux_texto);
		end loop; 

	END IF;
END IF;

select not_id into notid from noticias where not_tipo=1 and not_numero=operacion;

if found then 
    	    ret:='f';
	    if(int2eq(estado,1::int2) and int2eq(viejo_estado,1::int2)) THEN 
		    update operaciones set op_estado=11::int2 WHERE op_id = operacion;
	    end if;

	else

	    ret:='t';

    	    if (int2eq(estado,101::int2) and int2eq(viejo_estado,1::int2) and (fobopera>0)) then
		update operaciones set op_impdolar=fobopera WHERE op_id = operacion;
	    end if;
	
	    if(int2eq(modo,1::int2)) then	
	    update operaciones set op_estado=estado WHERE op_id = operacion;
	    end if;

end if;

if int2eq(estado,999::int2) then
    update operaciones set op_estado=estado WHERE op_id = operacion;
end if;


RETURN ret;
END;$_$;


ALTER FUNCTION public.verif_estado(integer, smallint, smallint) OWNER TO zona;

--
-- Name: volton_hay(integer); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION volton_hay(integer) RETURNS numeric
    LANGUAGE sql
    AS $_$select (vol_canting-vol_cantret) from voling where vol_idoper = $1;$_$;


ALTER FUNCTION public.volton_hay(integer) OWNER TO zona;

--
-- Name: volton_reti(integer); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION volton_reti(integer) RETURNS numeric
    LANGUAGE sql
    AS $_$select vole_cantret from volegr where vole_idoper = $1;$_$;


ALTER FUNCTION public.volton_reti(integer) OWNER TO zona;

--
-- Name: wfechainop(integer); Type: FUNCTION; Schema: public; Owner: zona
--

CREATE FUNCTION wfechainop(integer) RETURNS date
    LANGUAGE sql
    AS $_$select wop_fechain from woperaciones where wop_id= $1 ;$_$;


ALTER FUNCTION public.wfechainop(integer) OWNER TO zona;



--
-- Name: abucble; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE abucble (
    ac_id integer NOT NULL,
    ac_idtt integer DEFAULT 1,
    ac_idpad integer DEFAULT 1,
    ac_estado smallint DEFAULT 1,
    ac_reg integer NOT NULL,
    ac_modo integer NOT NULL
);


ALTER TABLE public.abucble OWNER TO zona;

--
-- Name: abucble_ac_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE abucble_ac_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.abucble_ac_id_seq OWNER TO zona;

--
-- Name: abucble_ac_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE abucble_ac_id_seq OWNED BY abucble.ac_id;


--
-- Name: accidentes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE accidentes (
    a_id integer NOT NULL,
    a_idemple integer,
    a_externo character varying(300),
    a_contrat character varying(100),
    a_fechaacc date NOT NULL,
    a_fechapres date,
    a_fechaalta date,
    a_tipo integer NOT NULL,
    a_estado integer DEFAULT 1
);


ALTER TABLE public.accidentes OWNER TO zona;

--
-- Name: accidentes_a_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE accidentes_a_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.accidentes_a_id_seq OWNER TO zona;

--
-- Name: accidentes_a_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE accidentes_a_id_seq OWNED BY accidentes.a_id;


--
-- Name: accioncalidad; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE accioncalidad (
    a_id integer NOT NULL,
    a_idobj integer,
    a_anio integer NOT NULL,
    a_accion text,
    a_idind integer,
    a_estado integer DEFAULT 1,
    a_codigo integer,
    a_proceso integer,
    a_orden integer
);


ALTER TABLE public.accioncalidad OWNER TO zona;

--
-- Name: accioncalidad_a_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE accioncalidad_a_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.accioncalidad_a_id_seq OWNER TO zona;

--
-- Name: accioncalidad_a_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE accioncalidad_a_id_seq OWNED BY accioncalidad.a_id;



--
-- Name: actas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE actas (
    acta_id integer NOT NULL,
    acta_subitem integer DEFAULT 1,
    acta_texto text,
    acta_canti numeric(15,5) DEFAULT 0,
    acta_tipo smallint,
    acta_estado smallint DEFAULT 1,
    acta_fecha date,
    acta_nroexped character varying(40),
    acta_idoper integer
);


ALTER TABLE public.actas OWNER TO zona;

--
-- Name: actas_acta_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE actas_acta_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.actas_acta_id_seq OWNER TO zona;

--
-- Name: actas_acta_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE actas_acta_id_seq OWNED BY actas.acta_id;



--
-- Name: activanualsh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE activanualsh (
    act_id integer NOT NULL,
    act_idcs integer,
    act_codigo integer,
    act_anio integer,
    act_tipo integer DEFAULT 1,
    act_nombre character varying(560),
    act_estado integer DEFAULT 1,
    act_idfm integer
);


ALTER TABLE public.activanualsh OWNER TO zona;

--
-- Name: activanualsh_act_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE activanualsh_act_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.activanualsh_act_id_seq OWNER TO zona;

--
-- Name: activanualsh_act_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE activanualsh_act_id_seq OWNED BY activanualsh.act_id;


--
-- Name: adjuntos_adj_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE adjuntos_adj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.adjuntos_adj_id_seq OWNER TO zona;


--
-- Name: adjuntos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE adjuntos (
    adj_id integer DEFAULT nextval('adjuntos_adj_id_seq'::regclass) NOT NULL,
    adj_idfm integer NOT NULL,
    adj_idoperad integer NOT NULL,
    adj_idheader integer NOT NULL,
    adj_archivo bytea,
    adj_estado integer DEFAULT 1
);


ALTER TABLE public.adjuntos OWNER TO zona;

--
-- Name: aduanas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE aduanas (
    adu_codigo smallint NOT NULL,
    adu_nombre character varying(40) NOT NULL
);


ALTER TABLE public.aduanas OWNER TO zona;

--
-- Name: almacen; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE almacen (
    alm_id integer NOT NULL,
    alm_idusu integer NOT NULL,
    alm_idsitem integer NOT NULL,
    alm_idcontr integer NOT NULL,
    alm_ultfac date DEFAULT now() NOT NULL,
    alm_retiro date,
    alm_tiprod integer NOT NULL,
    alm_tarifa numeric(15,5) NOT NULL,
    alm_estado smallint,
    alm_leyenda character varying(180)
);


ALTER TABLE public.almacen OWNER TO zona;

--
-- Name: almacen_alm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE almacen_alm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.almacen_alm_id_seq OWNER TO zona;

--
-- Name: almacen_alm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE almacen_alm_id_seq OWNED BY almacen.alm_id;



--
-- Name: almacenaje; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE almacenaje (
    al_id integer NOT NULL,
    al_idoper integer,
    al_idusu integer,
    al_idsitem integer,
    al_idcontr integer,
    al_canti numeric(15,5) DEFAULT 0,
    al_impdolar numeric(15,5) DEFAULT 0,
    al_importe numeric(15,5) DEFAULT 0,
    al_fecing date,
    al_fech date,
    al_ultfac date,
    al_retiro date,
    al_dias integer,
    al_tiprod integer,
    al_tarifa numeric(15,5) DEFAULT 0,
    al_total numeric(15,5) DEFAULT 0,
    al_estado smallint DEFAULT 1,
    al_leyenda text
);


ALTER TABLE public.almacenaje OWNER TO zona;

--
-- Name: almacenaje_al_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE almacenaje_al_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.almacenaje_al_id_seq OWNER TO zona;

--
-- Name: almacenaje_al_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE almacenaje_al_id_seq OWNED BY almacenaje.al_id;


--
-- Name: articc_artc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articc_artc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articc_artc_id_seq OWNER TO zona;


--
-- Name: articc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE articc (
    artc_id integer DEFAULT nextval('articc_artc_id_seq'::regclass) NOT NULL,
    artc_codigo character varying(160),
    artc_nombre character varying(260),
    artc_tasa numeric(20,5) DEFAULT 21,
    artc_estado integer DEFAULT 1,
    artc_unimed integer,
    artc_precio numeric(20,5) DEFAULT 0,
    artc_rubcomp integer,
    artc_codemp integer DEFAULT 1,
    artc_idptov integer,
    artc_stock numeric(20,5) DEFAULT 0,
    artc_nivrep numeric(20,5) DEFAULT 0,
    artc_present numeric(20,5) DEFAULT 0,
    artc_peso numeric(20,5) DEFAULT 0,
    artc_leyen text,
    artc_tipo integer DEFAULT 1,
    artc_funcion text,
    artc_idcbl integer
);


ALTER TABLE public.articc OWNER TO zona;

--
-- Name: articu; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE articu (
    artic_id integer NOT NULL,
    artic_indirecto integer NOT NULL,
    artic_codigo character varying(80) NOT NULL,
    artic_marca character varying(80),
    artic_modelo character varying(80),
    artic_descrip character varying(80),
    artic_present character varying(40),
    artic_tiprod integer,
    artic_posa character varying(15),
    artic_unimed smallint,
    artic_tiprodint integer
);


ALTER TABLE public.articu OWNER TO zona;

--
-- Name: articu1; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE articu1 (
    artic_id integer NOT NULL,
    artic_indirecto integer NOT NULL,
    artic_codigo character varying(40) NOT NULL,
    artic_marca character varying(40),
    artic_modelo character varying(40),
    artic_descrip character varying(40),
    artic_present character varying(40),
    artic_tiprod integer,
    artic_posa character varying(15),
    artic_unimed smallint
);


ALTER TABLE public.articu1 OWNER TO zona;

--
-- Name: articu_artc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articu_artc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articu_artc_id_seq OWNER TO zona;

--
-- Name: articu_artic_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articu_artic_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articu_artic_id_seq OWNER TO zona;

--
-- Name: articu_artic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE articu_artic_id_seq OWNED BY articu.artic_id;


--
-- Name: articud; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE articud (
    articd_id integer NOT NULL,
    articd_idartic integer NOT NULL,
    articd_indirecto integer NOT NULL,
    articd_codigo character varying(40) NOT NULL,
    articd_marca character varying(40),
    articd_modelo character varying(40),
    articd_descrip character varying(40),
    articd_present character varying(40),
    articd_tiprod integer,
    articd_posa character varying(15),
    articd_unimed smallint
);


ALTER TABLE public.articud OWNER TO zona;

--
-- Name: articud_articd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articud_articd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articud_articd_id_seq OWNER TO zona;

--
-- Name: articud_articd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE articud_articd_id_seq OWNED BY articud.articd_id;


--
-- Name: articud_articd_idartic_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articud_articd_idartic_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articud_articd_idartic_seq OWNER TO zona;

--
-- Name: articud_articd_idartic_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE articud_articd_idartic_seq OWNED BY articud.articd_idartic;


--
-- Name: articvta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE articvta (
    art_id integer NOT NULL,
    art_codigo smallint,
    art_tasa numeric(15,5) DEFAULT 0.21,
    art_stock numeric(15,5),
    art_nivrep numeric(15,5),
    art_unimed smallint,
    art_present numeric(15,5),
    art_peso numeric(15,5),
    art_estado smallint DEFAULT 1,
    art_codrub smallint,
    art_automatoper character varying(100),
    art_tipoper integer,
    art_idptov integer,
    art_precio_unique numeric(15,5),
    art_codemp integer,
    art_codi character varying(20),
    art_nombre character varying(60),
    art_leyen text,
    art_siste smallint DEFAULT 1,
    art_tipo smallint DEFAULT 1,
    art_codsrb integer,
    art_codcbl integer,
    art_funcion text,
    art_precio numeric(15,5) DEFAULT 0,
    art_idcbl integer
);


ALTER TABLE public.articvta OWNER TO zona;

--
-- Name: articvta_art_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE articvta_art_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.articvta_art_id_seq OWNER TO zona;

--
-- Name: articvta_art_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE articvta_art_id_seq OWNED BY articvta.art_id;


--
-- Name: artseg; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE artseg (
    as_id integer NOT NULL,
    as_tipo integer,
    as_idorig integer,
    as_ciaseg integer,
    as_poliza character varying(40),
    as_fecdes date DEFAULT date(now()),
    as_fechas date,
    as_estado smallint DEFAULT 1,
    as_obs text
);


ALTER TABLE public.artseg OWNER TO zona;

--
-- Name: artseg_as_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE artseg_as_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.artseg_as_id_seq OWNER TO zona;

--
-- Name: artseg_as_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE artseg_as_id_seq OWNED BY artseg.as_id;



--
-- Name: asistencia; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE asistencia (
    a_id integer NOT NULL,
    a_idemple integer NOT NULL,
    a_fecha date DEFAULT date(now()) NOT NULL,
    a_motivo character varying(230),
    a_obs text,
    a_estado integer DEFAULT 1,
    a_codmot integer,
    a_aniovac integer,
    a_obsint text
);


ALTER TABLE public.asistencia OWNER TO zona;

--
-- Name: asistencia_a_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE asistencia_a_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.asistencia_a_id_seq OWNER TO zona;

--
-- Name: asistencia_a_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE asistencia_a_id_seq OWNED BY asistencia.a_id;


--
-- Name: asistxcapac; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE asistxcapac (
    a_id integer NOT NULL,
    a_idcp integer,
    a_idgtexc integer,
    a_idfec integer,
    a_estado integer DEFAULT 1,
    a_eval integer DEFAULT (-1)
);


ALTER TABLE public.asistxcapac OWNER TO zona;

--
-- Name: asistxcapac_a_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE asistxcapac_a_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.asistxcapac_a_id_seq OWNER TO zona;

--
-- Name: asistxcapac_a_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE asistxcapac_a_id_seq OWNED BY asistxcapac.a_id;


--
-- Name: aspectoseval_ape_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE aspectoseval_ape_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.aspectoseval_ape_id_seq OWNER TO zona;

--
-- Name: aspectoseval; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE aspectoseval (
    ape_id integer DEFAULT nextval('aspectoseval_ape_id_seq'::regclass) NOT NULL,
    ape_idfm integer NOT NULL,
    ape_codigo integer NOT NULL,
    ape_nombre character varying(150) NOT NULL
);


ALTER TABLE public.aspectoseval OWNER TO zona;


--
-- Name: astoctas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE astoctas (
    astc_id integer NOT NULL,
    astc_idastoh integer NOT NULL,
    astc_codemp integer NOT NULL,
    astc_idptov integer,
    astc_iddiv integer,
    astc_idcco integer,
    astc_comprob integer NOT NULL,
    astc_numero integer NOT NULL,
    astc_fecval date NOT NULL,
    astc_ctacble integer NOT NULL,
    astc_moneda smallint DEFAULT 1 NOT NULL,
    astc_valor numeric(15,2) DEFAULT 0,
    astc_cotiza numeric(15,5) DEFAULT 0,
    astc_importe numeric(15,2) DEFAULT 0 NOT NULL,
    astc_tipcta integer,
    astc_ctacte integer,
    astc_nucheq integer DEFAULT 0,
    astc_fecvto date,
    astc_estado smallint DEFAULT 1 NOT NULL,
    astc_cierra smallint DEFAULT 1 NOT NULL,
    astc_grupo integer DEFAULT 1 NOT NULL,
    astc_tasa numeric(15,5),
    astc_leyen character varying(100),
    astc_idashce integer
);


ALTER TABLE public.astoctas OWNER TO zona;

--
-- Name: astoctas_astc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE astoctas_astc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.astoctas_astc_id_seq OWNER TO zona;

--
-- Name: astoctas_astc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE astoctas_astc_id_seq OWNED BY astoctas.astc_id;


--
-- Name: astoh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE astoh (
    ash_id integer NOT NULL,
    ash_codemp integer NOT NULL,
    ash_idptov integer,
    ash_anio smallint NOT NULL,
    ash_mes smallint NOT NULL,
    ash_comprob integer NOT NULL,
    ash_numero integer NOT NULL,
    ash_fecomp date NOT NULL,
    ash_fecval date,
    ash_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    ash_estado smallint DEFAULT 1,
    ash_idcpra integer,
    ash_idemiti integer,
    ash_nro2 integer,
    ash_leyen text,
    ash_operad integer,
    ash_date date,
    ash_titulo character varying(200),
    ash_observ text
);


ALTER TABLE public.astoh OWNER TO zona;

--
-- Name: astoh_ash_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE astoh_ash_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.astoh_ash_id_seq OWNER TO zona;

--
-- Name: astoh_ash_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE astoh_ash_id_seq OWNED BY astoh.ash_id;


--
-- Name: autorizaciones_au_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE autorizaciones_au_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.autorizaciones_au_id_seq OWNER TO zona;

--
-- Name: autorizaciones; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE autorizaciones (
    au_id integer DEFAULT nextval('autorizaciones_au_id_seq'::regclass) NOT NULL,
    au_idfm integer NOT NULL,
    au_idoperad integer NOT NULL,
    au_idheader integer NOT NULL,
    au_fecha timestamp without time zone DEFAULT now() NOT NULL,
    au_estado integer DEFAULT 1
);


ALTER TABLE public.autorizaciones OWNER TO zona;

--
-- Name: autorizados; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE autorizados (
    aut_id integer NOT NULL,
    aut_usuario integer NOT NULL,
    aut_nombre character varying(40),
    aut_tipdocu character varying(5) NOT NULL,
    aut_numdocu integer,
    aut_fechaa date DEFAULT now(),
    aut_fechav date,
    aut_estado smallint DEFAULT 1,
    aut_permiso smallint DEFAULT 1,
    aut_cargo integer
);


ALTER TABLE public.autorizados OWNER TO zona;

--
-- Name: autorizados_aut_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE autorizados_aut_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.autorizados_aut_id_seq OWNER TO zona;

--
-- Name: autorizados_aut_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE autorizados_aut_id_seq OWNED BY autorizados.aut_id;


--
-- Name: auxfe; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE auxfe (
    fe_id integer NOT NULL,
    fe_idcli integer NOT NULL,
    fe_cuit character varying(11) NOT NULL,
    fe_cbte smallint DEFAULT 1 NOT NULL,
    fe_ptovta smallint DEFAULT 1 NOT NULL,
    fe_nograv numeric(15,2),
    fe_grav numeric(15,2),
    fe_ivatot numeric(15,2),
    fe_total numeric(15,2),
    fe_tributo numeric(15,2),
    fe_ivaex numeric(15,2),
    fe_iva21 numeric(15,2),
    fe_iva105 numeric(15,2),
    fe_fechaf character varying(8),
    fe_iniserv character varying(8),
    fe_finserv character varying(8),
    fe_fechavp character varying(8),
    fe_cae character varying(14),
    fe_fechavtocae character varying(8),
    fe_numero integer,
    fe_estado integer DEFAULT 1 NOT NULL,
    fe_errores text,
    fe_observ text
);


ALTER TABLE public.auxfe OWNER TO zona;

--
-- Name: auxfe_fe_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE auxfe_fe_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.auxfe_fe_id_seq OWNER TO zona;

--
-- Name: auxfe_fe_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE auxfe_fe_id_seq OWNED BY auxfe.fe_id;


--
-- Name: auxoper; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE auxoper (
    auxo_idoper integer NOT NULL,
    auxo_compremb character varying(16),
    auxo_facturas character varying(190),
    auxo_monflet smallint,
    auxo_impflet numeric(15,2),
    auxo_impfletdol numeric(15,2),
    auxo_monseg smallint,
    auxo_impseg numeric(15,2),
    auxo_impsegdol numeric(15,2),
    auxo_plazo_suspens smallint,
    auxo_base_imponibl numeric(15,2),
    auxo_medio_transpo smallint,
    auxo_mat_medtransp character varying(40),
    auxo_fecha_oficial date,
    auxo_fecha_arribtr date,
    auxo_puerto character varying(5),
    auxo_fojas smallint,
    auxo_verif integer DEFAULT 1,
    auxo_veri_text text,
    auxo_veri_oper integer,
    aux_agentrans character varying(90),
    auxo_obs text,
    auxo_codobj character varying(100),
    auxo_obsestiba text,
    auxo_numfacvent character varying(20),
    auxo_empresafac integer,
    auxo_extratras character varying(120),
    auxo_anulacion text,
    auxo_buque text,
    auxo_porigen integer,
    auxo_despachante text
);


ALTER TABLE public.auxoper OWNER TO zona;

--
-- Name: auxoperv; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE auxoperv (
    avh_id integer NOT NULL,
    avh_idoper integer NOT NULL,
    avh_fecha_pub date,
    avh_fecha timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.auxoperv OWNER TO zona;

--
-- Name: auxoperv_avh_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE auxoperv_avh_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.auxoperv_avh_id_seq OWNER TO zona;

--
-- Name: auxoperv_avh_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE auxoperv_avh_id_seq OWNED BY auxoperv.avh_id;


--
-- Name: bancos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE bancos (
    bco_codigo smallint NOT NULL,
    bco_nombre character varying(40) NOT NULL,
    bco_estado smallint DEFAULT 1
);


ALTER TABLE public.bancos OWNER TO zona;


--
-- Name: bingoprueba; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE bingoprueba (
    id integer NOT NULL,
    valor integer,
    estado integer DEFAULT 1
);


ALTER TABLE public.bingoprueba OWNER TO zona;

--
-- Name: bingoprueba_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE bingoprueba_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.bingoprueba_id_seq OWNER TO zona;

--
-- Name: bingoprueba_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE bingoprueba_id_seq OWNED BY bingoprueba.id;



--
-- Name: calforms; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE calforms (
    cal_id integer NOT NULL,
    cal_fecreg timestamp without time zone DEFAULT now(),
    cal_fechad date,
    cal_archivo text,
    cal_observacion text,
    cal_operad text,
    cal_estado integer DEFAULT 1,
    cal_idfm integer
);


ALTER TABLE public.calforms OWNER TO zona;

--
-- Name: calforms_cal_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE calforms_cal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.calforms_cal_id_seq OWNER TO zona;

--
-- Name: calforms_cal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE calforms_cal_id_seq OWNED BY calforms.cal_id;



--
-- Name: calpersb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE calpersb (
    cb_id integer NOT NULL,
    cb_idch integer,
    cb_codsgc integer,
    cb_idpb integer,
    cb_tipo integer,
    cb_valor character varying(400),
    cb_estado integer DEFAULT 1
);


ALTER TABLE public.calpersb OWNER TO zona;

--
-- Name: calpersb_cb_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE calpersb_cb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.calpersb_cb_id_seq OWNER TO zona;

--
-- Name: calpersb_cb_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE calpersb_cb_id_seq OWNED BY calpersb.cb_id;



--
-- Name: calpersh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE calpersh (
    ch_id integer NOT NULL,
    ch_idfm integer,
    ch_idpp integer,
    ch_idemple integer,
    ch_obs text,
    ch_fecreg timestamp without time zone DEFAULT now(),
    ch_estado integer DEFAULT 1,
    ch_idoperad integer,
    ch_realizo character varying(80),
    ch_fecap date
);


ALTER TABLE public.calpersh OWNER TO zona;

--
-- Name: calpersh_ch_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE calpersh_ch_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.calpersh_ch_id_seq OWNER TO zona;

--
-- Name: calpersh_ch_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE calpersh_ch_id_seq OWNED BY calpersh.ch_id;


--
-- Name: capacitacion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE capacitacion (
    cp_id integer NOT NULL,
    cp_idfm integer,
    cp_mes integer,
    cp_anio integer,
    cp_motivo text,
    cp_tipo integer,
    cp_obs text,
    cp_fecreg timestamp without time zone DEFAULT now(),
    cp_estado integer DEFAULT 1,
    cp_nro integer,
    cp_objetivos text,
    cp_tipo2 integer,
    cp_depto integer,
    cp_replan integer
);


ALTER TABLE public.capacitacion OWNER TO zona;

--
-- Name: capacitacion_cp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE capacitacion_cp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.capacitacion_cp_id_seq OWNER TO zona;

--
-- Name: capacitacion_cp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE capacitacion_cp_id_seq OWNED BY capacitacion.cp_id;


--
-- Name: caratula; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE caratula (
    car_id integer NOT NULL,
    despacho text NOT NULL,
    destinacion text,
    cod_aduana text,
    cuit_despachante text,
    estado_declaracion text,
    tipo_impo_expo text,
    nro_reg_manifiesto text,
    motivo_suspensiva text,
    cuit_impo_expo text,
    nombre_impo_expo text,
    divisa_seguro text,
    divisa_flete text,
    divisa_fob text,
    plazo_suspensiva text,
    peso_bruto_bultos text,
    cantidad_bultos text,
    monto_seguro text,
    monto_flete text,
    monto_fob text,
    base_imponible text,
    medio_transporte text,
    marca_bultos text,
    condicion_venta text,
    codigo_deposito text,
    fecha_oficializ date,
    fecha_llegada_trans date,
    inscripto_en_iva text,
    cotizacion_pagos text,
    peso_guia text,
    transito text,
    codigo_embalaje text,
    tipo_embalaje text,
    nro_bultos text,
    cant_bultos_declar text,
    cant_unidad_medida text,
    unidad_medida text,
    cant_declarada text,
    cant_disponible text,
    referencias text,
    fecreg timestamp without time zone DEFAULT now(),
    estado smallint DEFAULT 1,
    car_wopid integer
);


ALTER TABLE public.caratula OWNER TO zona;

--
-- Name: caratula_car_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE caratula_car_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.caratula_car_id_seq OWNER TO zona;

--
-- Name: caratula_car_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE caratula_car_id_seq OWNED BY caratula.car_id;


--
-- Name: cargaydes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cargaydes (
    c_id integer NOT NULL,
    c_idfm integer,
    c_anio integer,
    c_fecha date NOT NULL,
    c_hora time without time zone NOT NULL,
    c_controlados integer,
    c_desvios integer,
    c_obs text,
    c_estado integer DEFAULT 1
);


ALTER TABLE public.cargaydes OWNER TO zona;

--
-- Name: cargaydes_c_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cargaydes_c_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cargaydes_c_id_seq OWNER TO zona;

--
-- Name: cargaydes_c_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cargaydes_c_id_seq OWNED BY cargaydes.c_id;



--
-- Name: cargopersonal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cargopersonal (
    car_id integer NOT NULL,
    car_idsrubp integer,
    car_idemple integer,
    car_nombreext text,
    car_estado integer DEFAULT 1,
    car_fecha date DEFAULT now(),
    car_fechabaja date
);


ALTER TABLE public.cargopersonal OWNER TO zona;

--
-- Name: cargopersonal_car_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cargopersonal_car_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cargopersonal_car_id_seq OWNER TO zona;

--
-- Name: cargopersonal_car_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cargopersonal_car_id_seq OWNED BY cargopersonal.car_id;


--
-- Name: cargos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cargos (
    car_id integer NOT NULL,
    car_nombre character varying(80),
    car_estado integer DEFAULT 1
);


ALTER TABLE public.cargos OWNER TO zona;

--
-- Name: cargos_car_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cargos_car_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cargos_car_id_seq OWNER TO zona;

--
-- Name: cargos_car_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cargos_car_id_seq OWNED BY cargos.car_id;



--
-- Name: carvis; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE carvis (
    cvt_id integer NOT NULL,
    cvt_gente integer NOT NULL,
    cvt_usuario integer,
    cvt_operad integer,
    cvt_estado smallint DEFAULT 1,
    cvt_fecdes date DEFAULT date(now()),
    cvt_fechas date DEFAULT date(now()),
    cvt_fecreg timestamp without time zone DEFAULT now()
);


ALTER TABLE public.carvis OWNER TO zona;

--
-- Name: carvis_cvt_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE carvis_cvt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.carvis_cvt_id_seq OWNER TO zona;

--
-- Name: carvis_cvt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE carvis_cvt_id_seq OWNED BY carvis.cvt_id;


--
-- Name: catego; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE catego (
    cat_codigo integer NOT NULL,
    cat_nombre character varying(40) NOT NULL
);


ALTER TABLE public.catego OWNER TO zona;

--
-- Name: catego_cat_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE catego_cat_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.catego_cat_codigo_seq OWNER TO zona;

--
-- Name: catego_cat_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE catego_cat_codigo_seq OWNED BY catego.cat_codigo;


--
-- Name: categoriaseval_cat_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE categoriaseval_cat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.categoriaseval_cat_id_seq OWNER TO zona;


--
-- Name: categoriaseval; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE categoriaseval (
    cat_id integer DEFAULT nextval('categoriaseval_cat_id_seq'::regclass) NOT NULL,
    cat_idfm integer NOT NULL,
    cat_codigo integer NOT NULL,
    cat_idaspecto integer NOT NULL,
    cat_nombre character varying(150) NOT NULL
);


ALTER TABLE public.categoriaseval OWNER TO zona;


--
-- Name: catimo; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE catimo (
    imo_codigo integer NOT NULL,
    imo_nombre character varying(40) NOT NULL
);


ALTER TABLE public.catimo OWNER TO zona;


--
-- Name: cauditado; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cauditado (
    c_id integer NOT NULL,
    c_idp integer,
    c_nombre text,
    c_area text,
    c_estado integer DEFAULT 1,
    c_idfm integer
);


ALTER TABLE public.cauditado OWNER TO zona;

--
-- Name: cauditado_c_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cauditado_c_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cauditado_c_id_seq OWNER TO zona;

--
-- Name: cauditado_c_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cauditado_c_id_seq OWNED BY cauditado.c_id;



--
-- Name: centroc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE centroc (
    cco_id integer NOT NULL,
    cco_codemp integer DEFAULT 1 NOT NULL,
    cco_idptov integer DEFAULT 1 NOT NULL,
    cco_coddiv integer DEFAULT 1 NOT NULL,
    cco_codigo smallint NOT NULL,
    cco_nombre character varying(30)
);


ALTER TABLE public.centroc OWNER TO zona;

--
-- Name: centroc_cco_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE centroc_cco_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.centroc_cco_id_seq OWNER TO zona;

--
-- Name: centroc_cco_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE centroc_cco_id_seq OWNED BY centroc.cco_id;


--
-- Name: certificados; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE certificados (
    cert_id integer NOT NULL,
    cert_idprov integer DEFAULT 1,
    cert_tipo integer DEFAULT 1,
    cert_fecvto date,
    cert_archivo bytea,
    cert_estado smallint DEFAULT 1
);


ALTER TABLE public.certificados OWNER TO zona;

--
-- Name: certificados_cert_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE certificados_cert_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.certificados_cert_id_seq OWNER TO zona;

--
-- Name: certificados_cert_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE certificados_cert_id_seq OWNED BY certificados.cert_id;


--
-- Name: cheques; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cheques (
    chq_id integer NOT NULL,
    chq_codbco smallint NOT NULL,
    chq_nucheq integer NOT NULL,
    chq_codemp integer NOT NULL,
    chq_idptov integer,
    chq_idastoc integer NOT NULL,
    chq_fechaem date,
    chq_fecheq date NOT NULL,
    chq_moneda smallint DEFAULT 1 NOT NULL,
    chq_importe numeric(15,2) DEFAULT 0 NOT NULL,
    chq_estado smallint DEFAULT 1 NOT NULL,
    chq_nrcuit character varying(20),
    chq_ctacte integer,
    chq_idastoce integer,
    chq_observ text,
    chq_echq integer
);


ALTER TABLE public.cheques OWNER TO zona;

--
-- Name: cheques_chq_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cheques_chq_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cheques_chq_id_seq OWNER TO zona;

--
-- Name: cheques_chq_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cheques_chq_id_seq OWNED BY cheques.chq_id;



--
-- Name: chkcontr; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE chkcontr (
    ce_id integer NOT NULL,
    ce_codsgc integer,
    ce_idic integer NOT NULL,
    ce_valor integer,
    ce_fecreg timestamp without time zone DEFAULT now(),
    ce_estado integer DEFAULT 1,
    ce_obs text
);


ALTER TABLE public.chkcontr OWNER TO zona;

--
-- Name: chkcontr_ce_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE chkcontr_ce_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chkcontr_ce_id_seq OWNER TO zona;

--
-- Name: chkcontr_ce_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE chkcontr_ce_id_seq OWNED BY chkcontr.ce_id;


--
-- Name: chklemp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE chklemp (
    ce_id integer NOT NULL,
    ce_idfm integer NOT NULL,
    ce_codsgc integer,
    ce_empleado integer NOT NULL,
    ce_valor integer,
    ce_fecreg timestamp without time zone DEFAULT now(),
    ce_estado integer DEFAULT 1
);


ALTER TABLE public.chklemp OWNER TO zona;

--
-- Name: chklemp_ce_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE chklemp_ce_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chklemp_ce_id_seq OWNER TO zona;

--
-- Name: chklemp_ce_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE chklemp_ce_id_seq OWNED BY chklemp.ce_id;


--
-- Name: chqrech; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE chqrech (
    chqr_id integer NOT NULL,
    chqr_cliente integer DEFAULT 1,
    chqr_idchq integer,
    chqr_idastoh integer,
    chqr_idastohc integer,
    chqr_texto text,
    chqr_estado smallint DEFAULT 1
);


ALTER TABLE public.chqrech OWNER TO zona;

--
-- Name: chqrech_chqr_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE chqrech_chqr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chqrech_chqr_id_seq OWNER TO zona;

--
-- Name: chqrech_chqr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE chqrech_chqr_id_seq OWNED BY chqrech.chqr_id;



--
-- Name: ciaseg; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ciaseg (
    cs_id integer NOT NULL,
    cs_nombre character varying(100) NOT NULL,
    cs_tipo integer DEFAULT 1,
    cs_nivel integer,
    cs_estado smallint DEFAULT 1
);


ALTER TABLE public.ciaseg OWNER TO zona;

--
-- Name: ciaseg_cs_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ciaseg_cs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ciaseg_cs_id_seq OWNER TO zona;

--
-- Name: ciaseg_cs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ciaseg_cs_id_seq OWNED BY ciaseg.cs_id;


--
-- Name: cixprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cixprov (
    cixp_prove integer NOT NULL,
    cixp_fecha date DEFAULT date(now()) NOT NULL,
    cixp_codiso integer NOT NULL,
    cixp_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.cixprov OWNER TO zona;

--
-- Name: clacont; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE clacont (
    clac_codigo integer NOT NULL,
    clac_nombre character(5) NOT NULL,
    clac_descrip character varying(40),
    clac_medida smallint,
    clac_altura numeric(15,5),
    clac_dimint_largo numeric(15,5),
    clac_dimint_ancho numeric(15,5),
    clac_dimint_alto numeric(15,5),
    clac_appuert_ancho numeric(15,5),
    clac_appuert_alto numeric(15,5),
    clac_capmax_peso numeric(15,5),
    clac_capmax_tara numeric(15,5),
    clac_capmax_neto numeric(15,5),
    clac_capmax_volume numeric(15,5),
    clac_orden integer
);


ALTER TABLE public.clacont OWNER TO zona;

--
-- Name: clacont_clac_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE clacont_clac_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clacont_clac_codigo_seq OWNER TO zona;

--
-- Name: clacont_clac_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE clacont_clac_codigo_seq OWNED BY clacont.clac_codigo;


--
-- Name: clientes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE clientes (
    cli_id integer NOT NULL,
    cli_codemp integer NOT NULL,
    cli_idptov integer,
    cli_codigo integer NOT NULL,
    cli_codaso integer,
    cli_nrcuit character varying(20),
    cli_tipcli smallint,
    cli_nombre character varying(300),
    cli_fantasy character varying(300),
    cli_nomabre character varying(40),
    cli_coniva smallint NOT NULL,
    cli_descto numeric(15,5) DEFAULT 0,
    cli_conpag integer,
    cli_catego integer,
    cli_limcred numeric(15,2),
    cli_interes numeric(15,5),
    cli_grupo integer DEFAULT 1,
    cli_saldo numeric(15,2),
    cli_estado smallint DEFAULT 1 NOT NULL,
    cli_modfac smallint DEFAULT 1,
    cli_mail character varying(150),
    cli_codviejo integer
);


ALTER TABLE public.clientes OWNER TO zona;


--
-- Name: clientes2; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE clientes2 (
    cli_id2 integer NOT NULL,
    cli_codemp integer NOT NULL,
    cli_idptov integer,
    cli_codigo integer NOT NULL,
    cli_codaso integer,
    cli_cuit2 character varying(20),
    cli_tipcli smallint,
    cli_nombre character varying(300),
    cli_fantasy character varying(300),
    cli_nomabre character varying(40),
    cli_coniva smallint NOT NULL,
    cli_descto numeric(15,5) DEFAULT 0,
    cli_conpag integer,
    cli_catego integer,
    cli_limcred numeric(15,2),
    cli_interes numeric(15,5),
    cli_grupo integer,
    cli_saldo numeric(15,2),
    cli_estado smallint DEFAULT 1 NOT NULL,
    cli_modfac smallint DEFAULT 1,
    cli_mail character varying(150)
);


ALTER TABLE public.clientes2 OWNER TO zona;

--
-- Name: clientes_cli_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE clientes_cli_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.clientes_cli_id_seq OWNER TO zona;

--
-- Name: clientes_cli_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE clientes_cli_id_seq OWNED BY clientes.cli_id;



--
-- Name: codiso; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE codiso (
    cdi_codigo integer NOT NULL,
    cdi_nombre character varying(140) NOT NULL
);


ALTER TABLE public.codiso OWNER TO zona;


--
-- Name: codobje; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE codobje (
    cob_id integer NOT NULL,
    cob_codigo integer,
    cob_nombre character varying(50),
    cob_estado smallint DEFAULT 1
);


ALTER TABLE public.codobje OWNER TO zona;

--
-- Name: codobje_cob_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE codobje_cob_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.codobje_cob_id_seq OWNER TO zona;

--
-- Name: codobje_cob_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE codobje_cob_id_seq OWNED BY codobje.cob_id;


--
-- Name: codobji; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE codobji (
    cob_id integer NOT NULL,
    cob_codigo integer,
    cob_nombre character varying(50),
    cob_estado smallint DEFAULT 1
);


ALTER TABLE public.codobji OWNER TO zona;

--
-- Name: codobji_cob_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE codobji_cob_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.codobji_cob_id_seq OWNER TO zona;

--
-- Name: codobji_cob_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE codobji_cob_id_seq OWNED BY codobji.cob_id;


--
-- Name: codsgc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE codsgc (
    cs_id integer NOT NULL,
    cs_idfm integer NOT NULL,
    cs_codrub integer,
    cs_nombre character varying(400) NOT NULL,
    cs_orden integer,
    cs_idsgc integer,
    cs_estado integer DEFAULT 1,
    cs_editable integer DEFAULT 1,
    cs_tipo integer DEFAULT 1,
    cs_relof integer,
    cs_correlativo character varying(300)
);


ALTER TABLE public.codsgc OWNER TO zona;

--
-- Name: codsgc_cs_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE codsgc_cs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.codsgc_cs_id_seq OWNER TO zona;

--
-- Name: codsgc_cs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE codsgc_cs_id_seq OWNED BY codsgc.cs_id;


--
-- Name: combustible; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE combustible (
    cm_id integer NOT NULL,
    cm_idfm integer,
    cm_idinst integer,
    cm_fecha date,
    cm_tipcomb integer,
    cm_kms character varying(20),
    cm_litros numeric(15,2),
    cm_importe numeric(15,2),
    cm_factura character varying(100),
    cm_responsable character varying(100),
    cm_ref text,
    cm_estado integer DEFAULT 1,
    cm_sector integer
);


ALTER TABLE public.combustible OWNER TO zona;

--
-- Name: combustible_cm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE combustible_cm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.combustible_cm_id_seq OWNER TO zona;

--
-- Name: combustible_cm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE combustible_cm_id_seq OWNED BY combustible.cm_id;



--
-- Name: comis; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE comis (
    com_id integer NOT NULL,
    com_nombre character varying(140) NOT NULL,
    com_idusu integer,
    com_fecini date,
    com_fech date,
    com_deudor smallint DEFAULT 1,
    com_estado smallint DEFAULT 1,
    com_leyenda text,
    com_mail character varying(180),
    com_tel1 character varying(180),
    com_tel2 character varying(180)
);


ALTER TABLE public.comis OWNER TO zona;

--
-- Name: comis_com_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE comis_com_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.comis_com_id_seq OWNER TO zona;

--
-- Name: comis_com_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE comis_com_id_seq OWNED BY comis.com_id;


--
-- Name: compadu; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE compadu (
    cad_codigo character(4) NOT NULL,
    cad_nombre character varying(40) NOT NULL,
    cad_destino character(1),
    cad_tipoper integer
);


ALTER TABLE public.compadu OWNER TO zona;

--
-- Name: complfac; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE complfac (
    cfac_id integer NOT NULL,
    cfac_codemp integer NOT NULL,
    cfac_ptov smallint DEFAULT 1,
    cfac_cliente integer,
    cfac_anio smallint,
    cfac_mes smallint,
    cfac_fechad date DEFAULT date(now()),
    cfac_fechah date,
    cfac_idart integer NOT NULL,
    cfac_canti numeric(15,5) DEFAULT 1,
    cfac_dias smallint DEFAULT 1,
    cfac_importe numeric(15,2) DEFAULT 0,
    cfac_estado smallint DEFAULT 1,
    cfac_funcion text,
    cfac_evento smallint DEFAULT 1,
    cfac_leyen text DEFAULT ' '::text,
    cfac_precio numeric(15,5)
);


ALTER TABLE public.complfac OWNER TO zona;

--
-- Name: complfac_cfac_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE complfac_cfac_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.complfac_cfac_id_seq OWNER TO zona;

--
-- Name: complfac_cfac_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE complfac_cfac_id_seq OWNED BY complfac.cfac_id;


--
-- Name: compra; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE compra (
    cpra_id integer NOT NULL,
    cpra_idastoh integer NOT NULL,
    cpra_codemp integer NOT NULL,
    cpra_idptov integer,
    cpra_comprob integer NOT NULL,
    cpra_numero integer NOT NULL,
    cpra_prove integer,
    cpra_lecomp character varying(2),
    cpra_sucomp smallint,
    cpra_nucomp integer,
    cpra_fecori date,
    cpra_fecval date,
    cpra_fecvto date,
    cpra_estado smallint DEFAULT 1 NOT NULL,
    cpra_nomprov character varying(80),
    cpra_nrcuit character varying(20),
    cpra_coniva smallint,
    cpra_total numeric(15,2) DEFAULT 0
);


ALTER TABLE public.compra OWNER TO zona;

--
-- Name: compra_cpra_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE compra_cpra_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.compra_cpra_id_seq OWNER TO zona;

--
-- Name: compra_cpra_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE compra_cpra_id_seq OWNED BY compra.cpra_id;


--
-- Name: comprob; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE comprob (
    comp_id integer NOT NULL,
    comp_codigo character(3) NOT NULL,
    comp_nombre character varying(40) NOT NULL,
    comp_idptov integer,
    comp_sistem smallint DEFAULT 1,
    comp_siste smallint DEFAULT 4,
    comp_credeb smallint DEFAULT 1,
    comp_stcksn smallint DEFAULT 1,
    comp_tipo smallint DEFAULT 1,
    comp_intext smallint DEFAULT 1,
    comp_cuenta integer,
    comp_talon integer,
    comp_copias integer,
    comp_letra character varying(3),
    comp_leyen text,
    comp_codemp integer
);


ALTER TABLE public.comprob OWNER TO zona;

--
-- Name: comprob_comp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE comprob_comp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.comprob_comp_id_seq OWNER TO zona;

--
-- Name: comprob_comp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE comprob_comp_id_seq OWNED BY comprob.comp_id;


--
-- Name: confactur; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE confactur (
    cfc_id integer NOT NULL,
    cfc_usuario integer NOT NULL,
    cfc_fecha date,
    cfc_anio smallint NOT NULL,
    cfc_mes smallint NOT NULL,
    cfc_idart integer NOT NULL,
    cfc_canti numeric(15,5),
    cfc_precio numeric(15,2),
    cfc_importe numeric(15,2),
    cfc_dias smallint,
    cfc_leyen character varying(40),
    cfc_idoper integer,
    cfc_estado smallint DEFAULT 1,
    cfc_idemiti integer,
    cfc_indirecto integer,
    cfc_fecreg timestamp without time zone DEFAULT now(),
    cfc_ticket integer,
    cfc_ptov smallint DEFAULT 2,
    cfc_usureal integer,
    cfc_idalm integer
);


ALTER TABLE public.confactur OWNER TO zona;

--
-- Name: confactur1; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE confactur1 (
    cfc1_id integer NOT NULL,
    cfc1_usuario integer NOT NULL,
    cfc1_fecha date,
    cfc1_anio smallint NOT NULL,
    cfc1_mes smallint NOT NULL,
    cfc1_idart integer NOT NULL,
    cfc1_canti numeric(15,5),
    cfc1_precio numeric(15,2),
    cfc1_importe numeric(15,2),
    cfc1_dias smallint,
    cfc1_leyen character varying(40),
    cfc1_idoper integer,
    cfc1_estado smallint DEFAULT 1,
    cfc1_idemiti integer,
    cfc1_indirecto integer,
    cfc1_fecreg timestamp without time zone DEFAULT now(),
    cfc1_ticket integer,
    cfc1_ptov smallint DEFAULT 2,
    cfc1_usureal integer,
    cfc_idalm1 integer
);


ALTER TABLE public.confactur1 OWNER TO zona;

--
-- Name: confactur1_cfc1_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE confactur1_cfc1_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.confactur1_cfc1_id_seq OWNER TO zona;

--
-- Name: confactur1_cfc1_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE confactur1_cfc1_id_seq OWNED BY confactur1.cfc1_id;


--
-- Name: confactur_cfc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE confactur_cfc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.confactur_cfc_id_seq OWNER TO zona;

--
-- Name: confactur_cfc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE confactur_cfc_id_seq OWNED BY confactur.cfc_id;


--
-- Name: coniva; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE coniva (
    iva_codigo smallint NOT NULL,
    iva_nombre character varying(30) NOT NULL,
    iva_tasa numeric(15,5),
    iva_stasa numeric(15,5),
    iva_discrim smallint DEFAULT 1
);


ALTER TABLE public.coniva OWNER TO zona;

--
-- Name: conpag; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE conpag (
    cdp_codigo integer NOT NULL,
    cdp_nombre character varying(40) NOT NULL,
    cdp_dias smallint
);


ALTER TABLE public.conpag OWNER TO zona;

--
-- Name: conpag_cdp_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE conpag_cdp_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.conpag_cdp_codigo_seq OWNER TO zona;

--
-- Name: conpag_cdp_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE conpag_cdp_codigo_seq OWNED BY conpag.cdp_codigo;


--
-- Name: consig; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE consig (
    csg_id integer NOT NULL,
    csg_nrocuit character varying(13) DEFAULT '0'::character varying NOT NULL,
    csg_nombre character varying(250),
    csg_fecvto date DEFAULT date(now()),
    csg_directo integer,
    csg_indirecto integer,
    csg_estado integer DEFAULT 1,
    csg_idold integer,
    csg_pais integer,
    csg_dispos character varying(40),
    csg_fecdes date DEFAULT date(now()),
    csg_histor text,
    csg_telef character varying(90),
    csg_email character varying(90),
    csg_cargo character varying(90),
    csg_domicilio character varying(90),
    csg_contacto character varying(90)
);


ALTER TABLE public.consig OWNER TO zona;

--
-- Name: consig_csg_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE consig_csg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.consig_csg_id_seq OWNER TO zona;

--
-- Name: consig_csg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE consig_csg_id_seq OWNED BY consig.csg_id;



--
-- Name: consumos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE consumos (
    cm_id integer NOT NULL,
    cm_idastoh integer DEFAULT 1,
    cm_mes integer,
    cm_anio integer,
    cm_cantidad numeric(15,5),
    cm_importe numeric(15,2),
    cm_identif character varying(200),
    cm_fecreg timestamp without time zone DEFAULT now(),
    cm_estado integer DEFAULT 1,
    cm_prove integer
);


ALTER TABLE public.consumos OWNER TO zona;

--
-- Name: consumos_cm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE consumos_cm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.consumos_cm_id_seq OWNER TO zona;

--
-- Name: consumos_cm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE consumos_cm_id_seq OWNED BY consumos.cm_id;



--
-- Name: contene; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE contene (
    cont_idopv integer NOT NULL,
    cont_marcont integer NOT NULL,
    cont_nrocont character varying(8) NOT NULL,
    cont_clacont integer NOT NULL,
    cont_idoper integer,
    cont_estado smallint DEFAULT 1,
    cont_preori character varying(20),
    cont_preana character varying(20),
    cont_presatel character varying(20),
    cont_fecing timestamp without time zone,
    cont_fecout timestamp without time zone,
    cont_idopvout integer
);


ALTER TABLE public.contene OWNER TO zona;

--
-- Name: conteven; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE conteven (
    contev_codigo integer NOT NULL,
    contev_descrip character varying(40) NOT NULL
);


ALTER TABLE public.conteven OWNER TO zona;

--
-- Name: conteven_contev_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE conteven_contev_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.conteven_contev_codigo_seq OWNER TO zona;

--
-- Name: conteven_contev_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE conteven_contev_codigo_seq OWNED BY conteven.contev_codigo;


--
-- Name: contratos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE contratos (
    contr_id integer NOT NULL,
    contr_locador integer NOT NULL,
    contr_locatario integer NOT NULL,
    contr_idsubt integer,
    contr_unifun smallint,
    contr_garantia numeric(15,2) DEFAULT 0,
    contr_step smallint DEFAULT 1,
    contr_facturable smallint DEFAULT 1,
    contr_leyenda text,
    contr_estado smallint DEFAULT 1,
    contr_metros numeric(15,5) DEFAULT 0,
    contr_puxmtro numeric(15,2) DEFAULT 0,
    contr_inter numeric(15,5) DEFAULT 1.5,
    contr_fecha1 date,
    contr_fecha2 date,
    contr_fecha3 date,
    contr_fecha4 date,
    contr_fecha5 date,
    contr_fecha6 date,
    contr_fecha7 date,
    contr_fecha8 date,
    contr_dispos character varying(50),
    contr_operador integer,
    contr_mtros2 numeric(15,5) DEFAULT 0,
    contr_vto2 date,
    contr_fecreg timestamp without time zone DEFAULT now()
);


ALTER TABLE public.contratos OWNER TO zona;


--
-- Name: contratos1; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE contratos1 (
    contr1_id integer NOT NULL,
    contr1_locador integer NOT NULL,
    contr1_locatario integer NOT NULL,
    contr1_idsubt integer,
    contr1_unifun smallint,
    contr1_garantia numeric(15,2) DEFAULT 0,
    contr1_step smallint DEFAULT 1,
    contr1_facturable smallint DEFAULT 1,
    contr1_leyenda text,
    contr1_estado smallint DEFAULT 1,
    contr1_metros numeric(15,5) DEFAULT 0,
    contr1_puxmtro numeric(15,2) DEFAULT 0,
    contr1_inter numeric(15,5) DEFAULT 1.5,
    contr1_fecha1 date,
    contr1_fecha2 date,
    contr1_fecha3 date,
    contr1_fecha4 date,
    contr1_fecha5 date,
    contr1_fecha6 date,
    contr1_fecha7 date,
    contr1_fecha8 date,
    contr1_dispos character varying(20)
);


ALTER TABLE public.contratos1 OWNER TO zona;

--
-- Name: contratos_contr_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE contratos_contr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.contratos_contr_id_seq OWNER TO zona;

--
-- Name: contratos_contr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE contratos_contr_id_seq OWNED BY contratos.contr_id;


--
-- Name: controldoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE controldoc (
    cd_id integer NOT NULL,
    cd_idcar integer DEFAULT 1,
    cd_fecha timestamp without time zone DEFAULT now() NOT NULL,
    cd_operador integer,
    cd_estado smallint DEFAULT 1,
    cd_idoper integer
);


ALTER TABLE public.controldoc OWNER TO zona;

--
-- Name: controldoc_cd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE controldoc_cd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.controldoc_cd_id_seq OWNER TO zona;

--
-- Name: controldoc_cd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE controldoc_cd_id_seq OWNED BY controldoc.cd_id;


--
-- Name: controlext; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE controlext (
    ex_id integer NOT NULL,
    ex_idfm integer NOT NULL,
    ex_idinst integer NOT NULL,
    ex_mes integer,
    ex_anio integer,
    ex_fecha date,
    ex_vtoh date,
    ex_vtoc date,
    ex_estado integer DEFAULT 1
);


ALTER TABLE public.controlext OWNER TO zona;

--
-- Name: controlext_ex_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE controlext_ex_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.controlext_ex_id_seq OWNER TO zona;

--
-- Name: controlext_ex_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE controlext_ex_id_seq OWNED BY controlext.ex_id;


--
-- Name: controlop; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE controlop (
    ctp_id integer NOT NULL,
    ctp_idoper integer NOT NULL,
    ctp_idoperv integer,
    ctp_operadori integer NOT NULL,
    ctp_operadorf integer,
    ctp_modo smallint DEFAULT 1 NOT NULL,
    ctp_inicio timestamp without time zone DEFAULT now() NOT NULL,
    ctp_fin timestamp without time zone,
    ctp_estado smallint DEFAULT 1,
    ctp_tipoper integer
);


ALTER TABLE public.controlop OWNER TO zona;

--
-- Name: controlop_ctp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE controlop_ctp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.controlop_ctp_id_seq OWNER TO zona;

--
-- Name: controlop_ctp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE controlop_ctp_id_seq OWNED BY controlop.ctp_id;



--
-- Name: contrprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE contrprov (
    cp_id integer NOT NULL,
    cp_fecreg timestamp without time zone DEFAULT now(),
    cp_operad integer DEFAULT 1,
    cp_prove integer DEFAULT 1,
    cp_objeto text,
    cp_fecha date DEFAULT date(now()),
    cp_vto date,
    cp_obs text,
    cp_domicilio text,
    cp_tel text,
    cp_mail text,
    cp_archivo text,
    cp_estado integer DEFAULT 1
);


ALTER TABLE public.contrprov OWNER TO zona;

--
-- Name: contrprov_cp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE contrprov_cp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.contrprov_cp_id_seq OWNER TO zona;

--
-- Name: contrprov_cp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE contrprov_cp_id_seq OWNED BY contrprov.cp_id;


--
-- Name: copia_astoctas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE copia_astoctas (
    astc_id integer NOT NULL,
    astc_idastoh integer NOT NULL,
    astc_codemp integer NOT NULL,
    astc_idptov integer,
    astc_iddiv integer,
    astc_idcco integer,
    astc_comprob integer NOT NULL,
    astc_numero integer NOT NULL,
    astc_fecval date NOT NULL,
    astc_ctacble integer NOT NULL,
    astc_moneda smallint DEFAULT 1 NOT NULL,
    astc_valor numeric(15,2) DEFAULT 0,
    astc_cotiza numeric(15,5) DEFAULT 0,
    astc_importe numeric(15,2) DEFAULT 0 NOT NULL,
    astc_tipcta integer,
    astc_ctacte integer,
    astc_nucheq integer DEFAULT 0,
    astc_fecvto date,
    astc_estado smallint DEFAULT 1 NOT NULL,
    astc_cierra smallint DEFAULT 1 NOT NULL,
    astc_grupo integer DEFAULT 1 NOT NULL,
    astc_tasa numeric(15,5),
    astc_leyen character varying(100),
    astc_idashce integer
);


ALTER TABLE public.copia_astoctas OWNER TO zona;

--
-- Name: copia_astoctas_astc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE copia_astoctas_astc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.copia_astoctas_astc_id_seq OWNER TO zona;

--
-- Name: copia_astoctas_astc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE copia_astoctas_astc_id_seq OWNED BY copia_astoctas.astc_id;


--
-- Name: cotiza; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cotiza (
    cot_moneda smallint NOT NULL,
    cot_fecha date NOT NULL,
    cot_cotiz numeric(15,6) DEFAULT 1 NOT NULL
);


ALTER TABLE public.cotiza OWNER TO zona;


--
-- Name: criticprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE criticprov (
    cp_id integer NOT NULL,
    cp_idprov integer DEFAULT 1,
    cp_valact integer,
    cp_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    cp_estado smallint DEFAULT 1
);


ALTER TABLE public.criticprov OWNER TO zona;

--
-- Name: criticprov_cp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE criticprov_cp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.criticprov_cp_id_seq OWNER TO zona;

--
-- Name: criticprov_cp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE criticprov_cp_id_seq OWNED BY criticprov.cp_id;


--
-- Name: csgxuf; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE csgxuf (
    cxu_id integer NOT NULL,
    cxu_fecreg timestamp without time zone DEFAULT now(),
    cxu_operad integer DEFAULT 1,
    cxu_idcsg integer DEFAULT 1,
    cxu_unifun integer,
    cxu_estado integer DEFAULT 1,
    cxu_fecvto date,
    cxu_metros numeric(15,2),
    cxu_directo integer,
    cxu_indirecto integer
);


ALTER TABLE public.csgxuf OWNER TO zona;

--
-- Name: csgxuf_cxu_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE csgxuf_cxu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.csgxuf_cxu_id_seq OWNER TO zona;

--
-- Name: csgxuf_cxu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE csgxuf_cxu_id_seq OWNED BY csgxuf.cxu_id;



--
-- Name: ctacble; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ctacble (
    cbl_id integer NOT NULL,
    cbl_codemp integer,
    cbl_codigo smallint NOT NULL,
    cbl_nombre character varying(50) NOT NULL,
    cbl_identi integer,
    cbl_moneda smallint NOT NULL,
    cbl_tipcta integer,
    cbl_ajuste smallint DEFAULT 1 NOT NULL,
    cbl_indice smallint,
    cbl_present character varying(15),
    cbl_estado smallint,
    cbl_tasa numeric(15,5) DEFAULT 21 NOT NULL
);


ALTER TABLE public.ctacble OWNER TO zona;

--
-- Name: ctacble_cbl_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ctacble_cbl_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ctacble_cbl_id_seq OWNER TO zona;

--
-- Name: ctacble_cbl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ctacble_cbl_id_seq OWNED BY ctacble.cbl_id;


--
-- Name: ctes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ctes (
    cte_id integer NOT NULL,
    cte_codemp integer,
    cte_tipcta integer NOT NULL,
    cte_tipct smallint,
    cte_codigo integer NOT NULL,
    cte_nombre character varying(300),
    cte_idtal integer,
    cte_estado smallint DEFAULT 1
);


ALTER TABLE public.ctes OWNER TO zona;

--
-- Name: ctes_cte_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ctes_cte_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ctes_cte_id_seq OWNER TO zona;

--
-- Name: ctes_cte_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ctes_cte_id_seq OWNED BY ctes.cte_id;



--
-- Name: cumplinfo; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE cumplinfo (
    cm_id integer NOT NULL,
    cm_idreg integer DEFAULT 1,
    cm_fecreg timestamp without time zone DEFAULT now(),
    cm_feclimite date,
    cm_feccump date,
    cm_observa text,
    cm_estado smallint DEFAULT 1,
    cm_operad integer,
    cm_fin timestamp without time zone
);


ALTER TABLE public.cumplinfo OWNER TO zona;

--
-- Name: cumplinfo_cm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE cumplinfo_cm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cumplinfo_cm_id_seq OWNER TO zona;

--
-- Name: cumplinfo_cm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE cumplinfo_cm_id_seq OWNED BY cumplinfo.cm_id;


--
-- Name: deadop; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE deadop (
    dd_id integer NOT NULL,
    dd_idfm integer,
    dd_fecha date,
    dd_idrg integer,
    dd_expte character varying(150),
    dd_obs text,
    dd_fecreg timestamp without time zone DEFAULT now(),
    dd_estado integer DEFAULT 1,
    dd_directo integer,
    dd_indirecto integer,
    dd_consig integer,
    dd_fecharet date,
    dd_destin text,
    dd_reexp text,
    dd_mercaderia text
);


ALTER TABLE public.deadop OWNER TO zona;

--
-- Name: deadop_dd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE deadop_dd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.deadop_dd_id_seq OWNER TO zona;

--
-- Name: deadop_dd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE deadop_dd_id_seq OWNED BY deadop.dd_id;


--
-- Name: deptos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE deptos (
    dep_codigo integer NOT NULL,
    dep_nombre character varying(140) NOT NULL,
    dep_proceso integer DEFAULT 2,
    dep_rrhh integer DEFAULT 1,
    dep_ordenrh integer
);


ALTER TABLE public.deptos OWNER TO zona;


--
-- Name: despach; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE despach (
    desp_id integer NOT NULL,
    desp_tipo smallint DEFAULT 1 NOT NULL,
    desp_nrcuit character(13) NOT NULL,
    desp_nroreg character(8) NOT NULL,
    desp_nombre character varying(40) NOT NULL
);


ALTER TABLE public.despach OWNER TO zona;

--
-- Name: despach_desp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE despach_desp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.despach_desp_id_seq OWNER TO zona;

--
-- Name: despach_desp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE despach_desp_id_seq OWNED BY despach.desp_id;



--
-- Name: dias; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE dias (
    i integer
);


ALTER TABLE public.dias OWNER TO zona;

--
-- Name: difcta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE difcta (
    dc_id integer NOT NULL,
    dc_codemp integer,
    dc_idptov integer,
    dc_mes integer,
    dc_anio integer,
    dc_ctacble integer,
    dc_importeacum numeric,
    dc_fecreg timestamp without time zone DEFAULT now(),
    dc_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.difcta OWNER TO zona;

--
-- Name: difcta_dc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE difcta_dc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.difcta_dc_id_seq OWNER TO zona;

--
-- Name: difcta_dc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE difcta_dc_id_seq OWNED BY difcta.dc_id;



--
-- Name: division; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE division (
    div_id integer NOT NULL,
    div_codemp integer DEFAULT 1 NOT NULL,
    div_idptov integer DEFAULT 1 NOT NULL,
    div_codigo smallint NOT NULL,
    div_nombre character varying(30)
);


ALTER TABLE public.division OWNER TO zona;

--
-- Name: division_div_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE division_div_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.division_div_id_seq OWNER TO zona;

--
-- Name: division_div_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE division_div_id_seq OWNED BY division.div_id;


--
-- Name: docexterno; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE docexterno (
    de_id integer NOT NULL,
    de_codigo text,
    de_nombre text NOT NULL,
    de_fecha date NOT NULL,
    de_version integer,
    de_archivo text,
    de_estado integer DEFAULT 1
);


ALTER TABLE public.docexterno OWNER TO zona;

--
-- Name: docexterno_de_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE docexterno_de_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.docexterno_de_id_seq OWNER TO zona;

--
-- Name: docexterno_de_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE docexterno_de_id_seq OWNED BY docexterno.de_id;


--
-- Name: docum; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE docum (
    doc_id integer NOT NULL,
    doc_codemp integer NOT NULL,
    doc_idptov integer,
    doc_idastoc integer NOT NULL,
    doc_numero integer NOT NULL,
    doc_fechaem date,
    doc_fecdoc date NOT NULL,
    doc_moneda smallint DEFAULT 1 NOT NULL,
    doc_importe numeric(15,2) DEFAULT 0 NOT NULL,
    doc_estado smallint DEFAULT 1 NOT NULL,
    doc_nrcuit character varying(20),
    doc_ctacte integer,
    doc_idastoce integer,
    doc_observ text
);


ALTER TABLE public.docum OWNER TO zona;

--
-- Name: docum_doc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE docum_doc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.docum_doc_id_seq OWNER TO zona;

--
-- Name: docum_doc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE docum_doc_id_seq OWNED BY docum.doc_id;



--
-- Name: documentacion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE documentacion (
    d_id integer NOT NULL,
    d_proceso integer,
    d_codigo text,
    d_nombre text,
    d_fecha date NOT NULL,
    d_revision integer NOT NULL,
    d_color text,
    d_obs text,
    d_estado integer DEFAULT 1
);


ALTER TABLE public.documentacion OWNER TO zona;

--
-- Name: documentacion_d_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE documentacion_d_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.documentacion_d_id_seq OWNER TO zona;

--
-- Name: documentacion_d_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE documentacion_d_id_seq OWNED BY documentacion.d_id;


--
-- Name: dow; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE dow (
    d_id integer NOT NULL,
    d_codigo integer,
    d_nombre character varying(350),
    d_abrev character varying(2)
);


ALTER TABLE public.dow OWNER TO zona;

--
-- Name: dow_d_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE dow_d_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dow_d_id_seq OWNER TO zona;

--
-- Name: dow_d_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE dow_d_id_seq OWNED BY dow.d_id;



--
-- Name: egretot; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE egretot (
    egt_id integer NOT NULL,
    egt_fecha text,
    egt_directo text,
    egt_indirecto text,
    egt_tipoper text,
    egt_numero text,
    egt_lote text,
    egt_compbte text,
    egt_articod text,
    egt_artidesc text,
    egt_chasis text,
    egt_combteeg text,
    egt_cantret text,
    egt_consig text,
    egt_reloper text,
    egt_despach text,
    egt_peso text,
    egt_bultos text,
    egt_embalaje text,
    egt_fobt text,
    egt_moneda text,
    egt_valcte text,
    egt_lotenum smallint,
    egt_idoper integer DEFAULT (-1),
    egt_iditem integer DEFAULT (-1),
    egt_idsitem integer DEFAULT (-1),
    egt_idret integer DEFAULT (-1),
    egt_esta integer DEFAULT (-1),
    egt_tipoperin text,
    egt_reloperin text,
    egt_numeroin text,
    egt_consigin text
);


ALTER TABLE public.egretot OWNER TO zona;

--
-- Name: egretot_egt_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE egretot_egt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.egretot_egt_id_seq OWNER TO zona;

--
-- Name: egretot_egt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE egretot_egt_id_seq OWNED BY egretot.egt_id;


--
-- Name: embalajes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE embalajes (
    emb_codigo smallint NOT NULL,
    emb_nombre character varying(40) NOT NULL,
    emb_coef numeric(15,5)
);


ALTER TABLE public.embalajes OWNER TO zona;


--
-- Name: emergencias; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE emergencias (
    e_id integer NOT NULL,
    e_idfm integer,
    e_fecha date NOT NULL,
    e_hora time without time zone NOT NULL,
    e_recibio character varying(500),
    e_realizo character varying(500),
    e_nrotel character varying(50),
    e_usuario text,
    e_motivo text,
    e_estado integer DEFAULT 1
);


ALTER TABLE public.emergencias OWNER TO zona;

--
-- Name: emergencias_e_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE emergencias_e_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.emergencias_e_id_seq OWNER TO zona;

--
-- Name: emergencias_e_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE emergencias_e_id_seq OWNED BY emergencias.e_id;



--
-- Name: emiti; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE emiti (
    emi_id integer NOT NULL,
    emi_idastoh integer NOT NULL,
    emi_codemp integer NOT NULL,
    emi_idptov integer,
    emi_comprob integer NOT NULL,
    emi_numero integer NOT NULL,
    emi_fecval date,
    emi_grupo integer,
    emi_conpag integer,
    emi_codcli integer,
    emi_succli integer,
    emi_nomcli character varying(300),
    emi_conivac smallint,
    emi_nrocuit character varying(20),
    emi_vended integer,
    emi_provin integer,
    emi_zona integer,
    emi_desre numeric(15,2) DEFAULT 0,
    emi_total numeric(15,2) DEFAULT 0,
    emi_retiro integer,
    emi_estado smallint DEFAULT 1,
    emi_leyen text,
    emi_idfe integer,
    emi_cae character varying(14),
    emi_tint numeric(15,6)
);


ALTER TABLE public.emiti OWNER TO zona;

--
-- Name: emiti_emi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE emiti_emi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.emiti_emi_id_seq OWNER TO zona;

--
-- Name: emiti_emi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE emiti_emi_id_seq OWNED BY emiti.emi_id;


--
-- Name: empleados; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE empleados (
    e_id integer NOT NULL,
    e_legajo integer NOT NULL,
    e_sexo integer,
    e_estciv integer,
    e_sector integer,
    e_nacion integer,
    e_nombre character varying(280) NOT NULL,
    e_fecnac date,
    e_fecing date,
    e_tipdoc character varying(4),
    e_nrodoc integer,
    e_cuil character varying(13),
    e_idoperad integer,
    e_estado integer DEFAULT 1,
    e_obschk text,
    e_idgente integer,
    e_fecout date,
    e_motbaja integer,
    e_horaing time without time zone,
    e_horaegr time without time zone,
    e_gerencia integer DEFAULT 2,
    e_jefe integer DEFAULT 2,
    e_brigada integer DEFAULT 2,
    e_jeferrhh integer DEFAULT 2,
    e_direccion character varying(300),
    e_tfijo character varying(300),
    e_talt character varying(300),
    e_obrasoc character varying(300),
    e_mailp character varying(300),
    e_fecvacp date
);


ALTER TABLE public.empleados OWNER TO zona;

--
-- Name: empleados_e_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE empleados_e_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.empleados_e_id_seq OWNER TO zona;

--
-- Name: empleados_e_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE empleados_e_id_seq OWNED BY empleados.e_id;


--
-- Name: empresa; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE empresa (
    emp_codigo integer NOT NULL,
    emp_nombre character varying(60),
    emp_direcc character varying(60),
    emp_locali character varying(60),
    emp_codpos character varying(10),
    emp_provin integer,
    emp_pais smallint,
    emp_nrcuit character varying(20),
    emp_estado smallint DEFAULT 1,
    emp_tipo smallint,
    emp_coniva smallint,
    emp_anti date,
    emp_fecint date,
    emp_grupo integer,
    emp_redond smallint,
    emp_nomabr character varying(7)
);


ALTER TABLE public.empresa OWNER TO zona;

--
-- Name: encuesta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE encuesta (
    e_id integer NOT NULL,
    e_idfm integer,
    e_leyini text,
    e_estado integer DEFAULT 1,
    e_usuario integer,
    e_empleado integer,
    e_proceso integer,
    e_capacitador integer,
    e_tematica integer,
    e_abrev text,
    e_redmine integer
);


ALTER TABLE public.encuesta OWNER TO zona;

--
-- Name: encuesta_e_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE encuesta_e_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.encuesta_e_id_seq OWNER TO zona;

--
-- Name: encuesta_e_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE encuesta_e_id_seq OWNED BY encuesta.e_id;


--
-- Name: entidad; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE entidad (
    ent_id integer NOT NULL,
    ent_niv1 smallint DEFAULT 0 NOT NULL,
    ent_niv2 smallint DEFAULT 0 NOT NULL,
    ent_niv3 smallint DEFAULT 0 NOT NULL,
    ent_niv4 smallint DEFAULT 0 NOT NULL,
    ent_niv5 smallint DEFAULT 0 NOT NULL,
    ent_nombre character varying(40)
);


ALTER TABLE public.entidad OWNER TO zona;

--
-- Name: entidad_ent_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE entidad_ent_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.entidad_ent_id_seq OWNER TO zona;

--
-- Name: entidad_ent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE entidad_ent_id_seq OWNED BY entidad.ent_id;


--
-- Name: esclisp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE esclisp (
    elp_idart integer NOT NULL,
    elp_orden smallint DEFAULT 1 NOT NULL,
    elp_nombre character varying(40) DEFAULT '1'::character varying,
    elp_precio numeric(15,2) NOT NULL
);


ALTER TABLE public.esclisp OWNER TO zona;

--
-- Name: escvalcont; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE escvalcont (
    escval_idcontrat integer NOT NULL,
    escval_fdesde date NOT NULL,
    escval_fhasta date NOT NULL,
    escval_importe numeric(15,2)
);


ALTER TABLE public.escvalcont OWNER TO zona;


--
-- Name: estaccid; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estaccid (
    e_id integer NOT NULL,
    e_idfm integer,
    e_mes integer NOT NULL,
    e_anio integer NOT NULL,
    e_dotacion integer,
    e_horas integer,
    e_estado integer DEFAULT 1
);


ALTER TABLE public.estaccid OWNER TO zona;

--
-- Name: estaccid_e_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE estaccid_e_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estaccid_e_id_seq OWNER TO zona;

--
-- Name: estaccid_e_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE estaccid_e_id_seq OWNED BY estaccid.e_id;


--
-- Name: estcivil; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estcivil (
    ec_codigo integer NOT NULL,
    ec_nombre character varying(280) NOT NULL,
    ec_estado integer DEFAULT 1
);


ALTER TABLE public.estcivil OWNER TO zona;

--
-- Name: estcivil_ec_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE estcivil_ec_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estcivil_ec_codigo_seq OWNER TO zona;

--
-- Name: estcivil_ec_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE estcivil_ec_codigo_seq OWNED BY estcivil.ec_codigo;



--
-- Name: estiba; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estiba (
    est_id integer NOT NULL,
    est_tipo integer,
    est_codigo character varying(5),
    est_numero integer,
    est_fecha date,
    est_destino integer,
    est_canti integer,
    est_importe numeric(15,2),
    est_codcli integer,
    est_directo integer,
    est_compbte character varying(20)
);


ALTER TABLE public.estiba OWNER TO zona;

--
-- Name: estiba_est_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE estiba_est_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estiba_est_id_seq OWNER TO zona;

--
-- Name: estiba_est_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE estiba_est_id_seq OWNED BY estiba.est_id;



--
-- Name: estjurid; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estjurid (
    ej_id integer NOT NULL,
    ej_fecreg timestamp without time zone DEFAULT now(),
    ej_idfm integer DEFAULT 1,
    ej_operad integer DEFAULT 1,
    ej_estudio text,
    ej_fecha date DEFAULT date(now()),
    ej_tema text,
    ej_obs text,
    ej_autorizado text,
    ej_estado integer DEFAULT 1
);


ALTER TABLE public.estjurid OWNER TO zona;

--
-- Name: estjurid_ej_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE estjurid_ej_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.estjurid_ej_id_seq OWNER TO zona;

--
-- Name: estjurid_ej_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE estjurid_ej_id_seq OWNED BY estjurid.ej_id;



--
-- Name: estoper; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estoper (
    eto_codigo smallint NOT NULL,
    eto_nombre character varying(40) NOT NULL
);


ALTER TABLE public.estoper OWNER TO zona;

--
-- Name: estunif; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estunif (
    etu_codigo smallint NOT NULL,
    etu_nombre character varying(30)
);


ALTER TABLE public.estunif OWNER TO zona;

--
-- Name: estusu; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE estusu (
    esc_codigo smallint NOT NULL,
    esc_nombre character varying(30) NOT NULL
);


ALTER TABLE public.estusu OWNER TO zona;

--
-- Name: evaluacion_eval_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE evaluacion_eval_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.evaluacion_eval_id_seq OWNER TO zona;


--
-- Name: evaluacion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE evaluacion (
    eval_id integer DEFAULT nextval('evaluacion_eval_id_seq'::regclass) NOT NULL,
    eval_idoperad integer NOT NULL,
    eval_idjuzg integer NOT NULL,
    eval_idopcion integer NOT NULL,
    eval_idcategoria integer NOT NULL,
    eval_estado numeric DEFAULT 1 NOT NULL,
    eval_justificacion text
);


ALTER TABLE public.evaluacion OWNER TO zona;

--
-- Name: evalxprove_exp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE evalxprove_exp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.evalxprove_exp_id_seq OWNER TO zona;

--
-- Name: evalxprove; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE evalxprove (
    exp_id integer DEFAULT nextval('evalxprove_exp_id_seq'::regclass) NOT NULL,
    exp_idprov integer NOT NULL,
    exp_idoper integer NOT NULL,
    exp_estado numeric DEFAULT 1 NOT NULL
);


ALTER TABLE public.evalxprove OWNER TO zona;


--
-- Name: eventos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE eventos (
    eve_codigo smallint NOT NULL,
    eve_nombre character varying(30) NOT NULL
);


ALTER TABLE public.eventos OWNER TO zona;

--
-- Name: evindi; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE evindi (
    evi_indice smallint NOT NULL,
    evi_fecha date NOT NULL,
    evi_valor numeric(15,5) DEFAULT 1
);


ALTER TABLE public.evindi OWNER TO zona;

--
-- Name: evxprov_evxp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE evxprov_evxp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.evxprov_evxp_id_seq OWNER TO zona;

--
-- Name: evxprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE evxprov (
    evxp_id integer DEFAULT nextval('evxprov_evxp_id_seq'::regclass) NOT NULL,
    evxp_idfm integer NOT NULL,
    evxp_prove integer NOT NULL,
    evxp_fecha date DEFAULT date(now()) NOT NULL,
    evxp_nota numeric(15,5) DEFAULT 0,
    evxp_estado integer DEFAULT 1 NOT NULL,
    evxp_fechatope date,
    evxp_finaliza date,
    evxp_nro integer NOT NULL,
    evxp_anio integer NOT NULL
);


ALTER TABLE public.evxprov OWNER TO zona;

--
-- Name: facturacion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE facturacion (
    fac_id integer NOT NULL,
    fac_codemp integer NOT NULL,
    fac_ptov smallint DEFAULT 1,
    fac_cliente integer NOT NULL,
    fac_fecha date DEFAULT date(now()),
    fac_fecfac date,
    fac_fecdes date,
    fac_fechas date,
    fac_anio smallint,
    fac_mes smallint,
    fac_idart integer NOT NULL,
    fac_canti numeric(15,5) DEFAULT 1,
    fac_dias smallint DEFAULT 1,
    fac_importe numeric(15,2) DEFAULT 0,
    fac_estado smallint DEFAULT 1,
    fac_fecreg timestamp without time zone DEFAULT now(),
    fac_idoper integer,
    fac_idemiti integer,
    fac_clireal integer,
    fac_leyen text,
    fac_precio numeric(15,5)
);


ALTER TABLE public.facturacion OWNER TO zona;

--
-- Name: facturacion_fac_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE facturacion_fac_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.facturacion_fac_id_seq OWNER TO zona;

--
-- Name: facturacion_fac_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE facturacion_fac_id_seq OWNED BY facturacion.fac_id;



--
-- Name: fcxinv; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE fcxinv (
    fxi_id integer NOT NULL,
    fxi_idinv integer DEFAULT 1,
    fxi_idastoh integer DEFAULT 1,
    fxi_descripcion character varying(40),
    fxi_ivadestin numeric(15,2),
    fxi_retenido numeric(15,2),
    fxi_mespago integer,
    fxi_aniopago integer,
    fxi_motnoreten integer,
    fxi_rgnoret integer,
    fxi_agreten character varying(3) DEFAULT '018'::character varying,
    fxi_tipocf character varying(1) DEFAULT 'D'::character varying,
    fxi_medpag character varying(2) DEFAULT '03'::character varying,
    fxi_fecreg timestamp without time zone DEFAULT now(),
    fxi_estado integer DEFAULT 1
);


ALTER TABLE public.fcxinv OWNER TO zona;

--
-- Name: fcxinv_fxi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE fcxinv_fxi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fcxinv_fxi_id_seq OWNER TO zona;

--
-- Name: fcxinv_fxi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE fcxinv_fxi_id_seq OWNED BY fcxinv.fxi_id;



--
-- Name: feccontra; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE feccontra (
    fechac_idcontra integer NOT NULL,
    fechac_codevent integer NOT NULL,
    fechac_fecha date NOT NULL,
    fechac_aviso text
);


ALTER TABLE public.feccontra OWNER TO zona;

--
-- Name: fecxcapac; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE fecxcapac (
    fc_id integer NOT NULL,
    fc_idcap integer,
    fc_fecha date,
    fc_tipo integer,
    fc_estado integer DEFAULT 1,
    fc_idfc integer,
    fc_eficaz integer
);


ALTER TABLE public.fecxcapac OWNER TO zona;

--
-- Name: fecxcapac_fc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE fecxcapac_fc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fecxcapac_fc_id_seq OWNER TO zona;

--
-- Name: fecxcapac_fc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE fecxcapac_fc_id_seq OWNED BY fecxcapac.fc_id;



--
-- Name: fecxinictr; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE fecxinictr (
    fci_id integer NOT NULL,
    fci_idini integer,
    fci_nrofecha integer DEFAULT 0,
    fci_fecha date,
    fci_estado integer DEFAULT 1
);


ALTER TABLE public.fecxinictr OWNER TO zona;

--
-- Name: fecxinictr_fci_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE fecxinictr_fci_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fecxinictr_fci_id_seq OWNER TO zona;

--
-- Name: fecxinictr_fci_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE fecxinictr_fci_id_seq OWNED BY fecxinictr.fci_id;


--
-- Name: feriados; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE feriados (
    f_id integer NOT NULL,
    f_dia integer,
    f_mes integer,
    f_anio integer,
    f_modo integer,
    f_estado smallint DEFAULT 1
);


ALTER TABLE public.feriados OWNER TO zona;

--
-- Name: feriados_f_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE feriados_f_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.feriados_f_id_seq OWNER TO zona;

--
-- Name: feriados_f_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE feriados_f_id_seq OWNED BY feriados.f_id;



--
-- Name: firman; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE firman (
    fir_id integer NOT NULL,
    fir_nrcuit character varying(20) NOT NULL,
    fir_nombre character varying(60) NOT NULL,
    fir_direcc character varying(60),
    fir_locali character varying(60),
    fir_codpos character varying(10),
    fir_provin integer,
    fir_pais smallint,
    fir_estado smallint DEFAULT 1,
    fir_observ text
);


ALTER TABLE public.firman OWNER TO zona;

--
-- Name: firman_fir_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE firman_fir_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.firman_fir_id_seq OWNER TO zona;

--
-- Name: firman_fir_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE firman_fir_id_seq OWNED BY firman.fir_id;


--
-- Name: firmdedepto_fd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE firmdedepto_fd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.firmdedepto_fd_id_seq OWNER TO zona;

--
-- Name: firmdedepto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE firmdedepto (
    fd_id integer DEFAULT nextval('firmdedepto_fd_id_seq'::regclass) NOT NULL,
    fd_iddpto integer NOT NULL,
    fd_idoperad integer NOT NULL,
    fd_estado integer DEFAULT 1,
    fd_idform integer
);


ALTER TABLE public.firmdedepto OWNER TO zona;

--
-- Name: firmxform_ff_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE firmxform_ff_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.firmxform_ff_id_seq OWNER TO zona;

--
-- Name: firmxform; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE firmxform (
    ff_id integer DEFAULT nextval('firmxform_ff_id_seq'::regclass) NOT NULL,
    ff_idform integer NOT NULL,
    ff_iddpto integer NOT NULL,
    ff_estado integer DEFAULT 1,
    ff_modo integer,
    ff_nivel integer
);


ALTER TABLE public.firmxform OWNER TO zona;


--
-- Name: foda; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE foda (
    f_id integer NOT NULL,
    f_tipo integer,
    f_texto text,
    f_nro integer,
    f_riesgo integer,
    f_operador integer,
    f_fecreg timestamp without time zone DEFAULT now(),
    f_estado integer DEFAULT 1 NOT NULL,
    f_nombre text
);


ALTER TABLE public.foda OWNER TO zona;

--
-- Name: foda_f_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE foda_f_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.foda_f_id_seq OWNER TO zona;

--
-- Name: foda_f_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE foda_f_id_seq OWNED BY foda.f_id;


--
-- Name: formulario_fm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE formulario_fm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.formulario_fm_id_seq OWNER TO zona;


--
-- Name: formulario; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE formulario (
    fm_id integer DEFAULT nextval('formulario_fm_id_seq'::regclass) NOT NULL,
    fm_modulo integer NOT NULL,
    fm_proceso integer NOT NULL,
    fm_revision integer NOT NULL,
    fm_descrip text,
    fm_operadal integer NOT NULL,
    fm_fecal date DEFAULT date(now()) NOT NULL,
    fm_operadap integer,
    fm_fecap date,
    fm_program character varying(240),
    fm_obs text,
    fm_estado integer DEFAULT 1,
    fm_abrev text,
    fm_idref integer
);


ALTER TABLE public.formulario OWNER TO zona;


--
-- Name: fueros; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE fueros (
    f_id integer NOT NULL,
    f_nombre character varying(380) NOT NULL,
    f_estado integer DEFAULT 1
);


ALTER TABLE public.fueros OWNER TO zona;

--
-- Name: fueros_f_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE fueros_f_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fueros_f_id_seq OWNER TO zona;

--
-- Name: fueros_f_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE fueros_f_id_seq OWNED BY fueros.f_id;



--
-- Name: gente; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE gente (
    gte_id integer NOT NULL,
    gte_tdoc character varying(5) NOT NULL,
    gte_nrodoc integer DEFAULT 0 NOT NULL,
    gte_cuitl character varying(20),
    gte_nombre character varying(60) DEFAULT 'NN'::character varying NOT NULL,
    gte_fecnac date,
    gte_nacion smallint,
    gte_direcc character varying(100),
    gte_locali character varying(60),
    gte_codpos character varying(10),
    gte_provin integer,
    gte_pais smallint,
    gte_telefon character varying(200),
    gte_mail character varying(200),
    gte_estado smallint DEFAULT 1,
    gte_fecdes date DEFAULT date(now()),
    gte_fechas date DEFAULT '2025-12-31'::date,
    gte_horades time without time zone,
    gte_horahas time without time zone,
    gte_bandah integer DEFAULT 0 NOT NULL,
    gte_tarjeta integer,
    gte_grupo integer,
    gte_tipo integer DEFAULT 0,
    gte_usu integer,
    gte_foto character varying(160),
    gte_fecalta timestamp without time zone DEFAULT now(),
    gte_obs text,
    gte_operad integer,
    gte_leyen text
);


ALTER TABLE public.gente OWNER TO zona;

--
-- Name: gente_gte_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE gente_gte_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.gente_gte_id_seq OWNER TO zona;

--
-- Name: gente_gte_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE gente_gte_id_seq OWNED BY gente.gte_id;


--
-- Name: grupos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE grupos (
    gpo_id integer NOT NULL,
    gpo_nombre character varying(30) NOT NULL
);


ALTER TABLE public.grupos OWNER TO zona;

--
-- Name: grupos_gpo_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE grupos_gpo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.grupos_gpo_id_seq OWNER TO zona;

--
-- Name: grupos_gpo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE grupos_gpo_id_seq OWNED BY grupos.gpo_id;



--
-- Name: gtexcapac; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE gtexcapac (
    gc_id integer NOT NULL,
    gc_idcap integer,
    gc_idgte integer,
    gc_idemple integer,
    gc_externo character varying(300),
    gc_asistio integer,
    gc_idfec integer,
    gc_tipo integer,
    gc_estado integer DEFAULT 1,
    gc_duracion integer,
    gc_replan integer
);


ALTER TABLE public.gtexcapac OWNER TO zona;

--
-- Name: gtexcapac_gc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE gtexcapac_gc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.gtexcapac_gc_id_seq OWNER TO zona;

--
-- Name: gtexcapac_gc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE gtexcapac_gc_id_seq OWNED BY gtexcapac.gc_id;



--
-- Name: hallazgos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE hallazgos (
    h_id integer NOT NULL,
    h_numero integer NOT NULL,
    h_tipo integer DEFAULT 1 NOT NULL,
    h_fecha date DEFAULT date(now()) NOT NULL,
    h_depto integer,
    h_ori1 integer,
    h_ori2 integer,
    h_ori3 integer,
    h_ori4 integer,
    h_detecto integer,
    h_descrip text,
    h_accioni text,
    h_fecha2 date,
    h_reqacc integer,
    h_idplan integer,
    h_fecprev date,
    h_efectiv integer DEFAULT 1,
    h_fecef date,
    h_obs text,
    h_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    h_operad integer,
    h_idfm integer,
    h_estado integer DEFAULT 1
);


ALTER TABLE public.hallazgos OWNER TO zona;

--
-- Name: hallazgos_h_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE hallazgos_h_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.hallazgos_h_id_seq OWNER TO zona;

--
-- Name: hallazgos_h_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE hallazgos_h_id_seq OWNED BY hallazgos.h_id;



--
-- Name: hijcble; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE hijcble (
    hc_id integer NOT NULL,
    hc_idcble integer DEFAULT 1,
    hc_estado smallint DEFAULT 1,
    hc_reg integer,
    hc_padcble integer NOT NULL
);


ALTER TABLE public.hijcble OWNER TO zona;

--
-- Name: hijcble_hc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE hijcble_hc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.hijcble_hc_id_seq OWNER TO zona;

--
-- Name: hijcble_hc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE hijcble_hc_id_seq OWNED BY hijcble.hc_id;



--
-- Name: histarifas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE histarifas (
    htari_idart integer NOT NULL,
    htari_usuario integer NOT NULL,
    htari_orden smallint DEFAULT 1 NOT NULL,
    htari_fecha date DEFAULT now() NOT NULL,
    htari_tipo smallint DEFAULT 1 NOT NULL,
    htari_fdesde date,
    htari_fhasta date,
    htari_cdesde numeric(15,5) DEFAULT 0,
    htari_chasta numeric(15,5) DEFAULT 0,
    htari_ddesde smallint,
    htari_dhasta smallint,
    htari_importe numeric(15,5) DEFAULT 0,
    htari_formula character varying(100)
);


ALTER TABLE public.histarifas OWNER TO zona;

--
-- Name: histcamb_hc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE histcamb_hc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.histcamb_hc_id_seq OWNER TO zona;

--
-- Name: histcamb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE histcamb (
    hc_id integer DEFAULT nextval('histcamb_hc_id_seq'::regclass) NOT NULL,
    hc_modulo integer NOT NULL,
    hc_revision integer NOT NULL,
    hc_descrip text,
    hc_fecha timestamp without time zone DEFAULT now() NOT NULL,
    hc_operadr integer,
    hc_operadv integer,
    hc_operada integer,
    hc_estado integer DEFAULT 1
);


ALTER TABLE public.histcamb OWNER TO zona;

--
-- Name: impresiones; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE impresiones (
    imp_codigo smallint NOT NULL,
    imp_name text,
    imp_query text,
    imp_enscript text,
    imp_filter text,
    imp_shell text
);


ALTER TABLE public.impresiones OWNER TO zona;


--
-- Name: indgestion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE indgestion (
    ind_id integer NOT NULL,
    ind_idfm integer,
    ind_proceso integer,
    ind_detalle text,
    ind_interpretacion text,
    ind_calculo text,
    ind_responsable text,
    ind_freq integer,
    ind_criterio text,
    ind_estado integer DEFAULT 1,
    ind_mostrable integer DEFAULT 1,
    ind_abrev character varying(15),
    ind_leyen1 text,
    ind_leyen2 text,
    ind_leyen3 text
);


ALTER TABLE public.indgestion OWNER TO zona;

--
-- Name: indgestion_ind_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE indgestion_ind_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.indgestion_ind_id_seq OWNER TO zona;

--
-- Name: indgestion_ind_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE indgestion_ind_id_seq OWNED BY indgestion.ind_id;



--
-- Name: indicador; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE indicador (
    ind_id integer NOT NULL,
    ind_tipo integer NOT NULL,
    ind_anio integer NOT NULL,
    ind_mes integer NOT NULL,
    ind_valor numeric(15,2) DEFAULT 0,
    ind_estado integer DEFAULT 1,
    ind_fecha date
);


ALTER TABLE public.indicador OWNER TO zona;

--
-- Name: indicador_ind_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE indicador_ind_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.indicador_ind_id_seq OWNER TO zona;

--
-- Name: indicador_ind_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE indicador_ind_id_seq OWNED BY indicador.ind_id;


--
-- Name: indices; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE indices (
    ind_codigo smallint NOT NULL,
    ind_nombre character varying(30) NOT NULL
);


ALTER TABLE public.indices OWNER TO zona;


--
-- Name: inflacion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inflacion (
    inf_id integer NOT NULL,
    inf_mes integer,
    inf_anio integer,
    inf_coef numeric,
    inf_fecreg timestamp without time zone DEFAULT now(),
    inf_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.inflacion OWNER TO zona;

--
-- Name: inflacion_inf_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inflacion_inf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inflacion_inf_id_seq OWNER TO zona;

--
-- Name: inflacion_inf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inflacion_inf_id_seq OWNED BY inflacion.inf_id;



--
-- Name: ingxl; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ingxl (
    igxl_iol integer NOT NULL,
    igxl_io integer NOT NULL,
    igxl_estado smallint DEFAULT 1
);


ALTER TABLE public.ingxl OWNER TO zona;


--
-- Name: inhabilit; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inhabilit (
    inh_id integer NOT NULL,
    inh_usuario integer,
    inh_deposito integer,
    inh_estado smallint DEFAULT 1,
    inh_fecdes date DEFAULT now(),
    inh_fechas date,
    inh_operadi integer,
    inh_operadh integer,
    inh_motivo text,
    inh_cont integer
);


ALTER TABLE public.inhabilit OWNER TO zona;

--
-- Name: inhabilit_inh_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inhabilit_inh_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inhabilit_inh_id_seq OWNER TO zona;

--
-- Name: inhabilit_inh_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inhabilit_inh_id_seq OWNED BY inhabilit.inh_id;



--
-- Name: inichk; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inichk (
    ic_id integer NOT NULL,
    ic_idfm integer NOT NULL,
    ic_usu integer,
    ic_fecusu date,
    ic_ubica text,
    ic_feccontr date,
    ic_fecreg timestamp without time zone DEFAULT now(),
    ic_estado integer DEFAULT 1
);


ALTER TABLE public.inichk OWNER TO zona;

--
-- Name: inichk_ic_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inichk_ic_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inichk_ic_id_seq OWNER TO zona;

--
-- Name: inichk_ic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inichk_ic_id_seq OWNED BY inichk.ic_id;


--
-- Name: inicontr; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inicontr (
    ini_id integer NOT NULL,
    ini_nro integer,
    ini_fecreg timestamp without time zone DEFAULT now(),
    ini_tieneusu integer,
    ini_usuario integer,
    ini_nomcli character varying(130),
    ini_tipo integer,
    ini_objeto text,
    ini_tipopago integer DEFAULT 0,
    ini_notadpfz character varying(20),
    ini_observado integer DEFAULT 2,
    ini_encuesta integer DEFAULT 2,
    ini_recepencuesta integer DEFAULT 2,
    ini_observacion text,
    ini_estado integer DEFAULT 1,
    ini_fecfin timestamp without time zone,
    ini_concretado integer DEFAULT 0
);


ALTER TABLE public.inicontr OWNER TO zona;

--
-- Name: inicontr_ini_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inicontr_ini_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inicontr_ini_id_seq OWNER TO zona;

--
-- Name: inicontr_ini_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inicontr_ini_id_seq OWNED BY inicontr.ini_id;


--
-- Name: inout; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE "inout" (
    io_id integer NOT NULL,
    io_gente integer NOT NULL,
    io_tarje integer,
    io_fecin timestamp without time zone DEFAULT now(),
    io_fecout timestamp without time zone,
    io_estado smallint DEFAULT 1,
    io_visita integer,
    io_barrei integer NOT NULL,
    io_barreo integer,
    io_operin integer,
    io_operout integer,
    io_obs text
);


ALTER TABLE public."inout" OWNER TO zona;

--
-- Name: inout_io_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inout_io_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inout_io_id_seq OWNER TO zona;

--
-- Name: inout_io_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inout_io_id_seq OWNED BY "inout".io_id;


--
-- Name: inoutliv; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inoutliv (
    iol_id integer NOT NULL,
    iol_liviano integer NOT NULL,
    iol_fecin timestamp without time zone DEFAULT now(),
    iol_fecout timestamp without time zone,
    iol_estado smallint DEFAULT 1,
    iol_barrei integer NOT NULL,
    iol_barreo integer,
    iol_obs text
);


ALTER TABLE public.inoutliv OWNER TO zona;

--
-- Name: inoutliv_iol_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inoutliv_iol_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inoutliv_iol_id_seq OWNER TO zona;

--
-- Name: inoutliv_iol_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inoutliv_iol_id_seq OWNED BY inoutliv.iol_id;



--
-- Name: instrumentos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE instrumentos (
    i_id integer NOT NULL,
    i_tipo integer,
    i_codigo character varying(20),
    i_marca character varying(80),
    i_modelo character varying(80),
    i_serie character varying(80),
    i_numaq character varying(80),
    i_patente character varying(10),
    i_freq character varying(50),
    i_anio integer,
    i_estado integer DEFAULT 1,
    i_idcs integer,
    i_ubicacion character varying(180),
    i_tipoex integer,
    i_capacidad numeric(15,2),
    i_fecbaja timestamp without time zone
);


ALTER TABLE public.instrumentos OWNER TO zona;

--
-- Name: instrumentos_i_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE instrumentos_i_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.instrumentos_i_id_seq OWNER TO zona;

--
-- Name: instrumentos_i_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE instrumentos_i_id_seq OWNED BY instrumentos.i_id;


--
-- Name: integrsoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE integrsoc (
    is_id integer NOT NULL,
    is_cuit character varying(13),
    is_porcentaje numeric(5,2),
    is_estado integer DEFAULT 1
);


ALTER TABLE public.integrsoc OWNER TO zona;

--
-- Name: integrsoc_is_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE integrsoc_is_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.integrsoc_is_id_seq OWNER TO zona;

--
-- Name: integrsoc_is_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE integrsoc_is_id_seq OWNED BY integrsoc.is_id;



--
-- Name: interes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE interes (
    int_codemp integer NOT NULL,
    int_fecha date NOT NULL,
    int_valor numeric(15,4) DEFAULT 0
);


ALTER TABLE public.interes OWNER TO zona;

--
-- Name: intotal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE intotal (
    int_id integer NOT NULL,
    int_fecha text,
    int_directo text,
    int_indirecto text,
    int_tipoper text,
    int_numero text,
    int_lote text,
    int_compbte text,
    int_articod text,
    int_artidesc text,
    int_chasis text,
    int_canting text,
    int_cantret text,
    int_cantstock text,
    int_unimed text,
    int_valori text,
    int_moneda text,
    int_valcte text,
    int_deposito text,
    int_reloper text,
    int_consig text,
    int_estado text,
    int_conocim text,
    int_bultos text,
    int_embalaje text,
    int_peso text,
    int_tiprod text,
    int_cantcomp text,
    int_fobt text,
    int_tipcbo text,
    int_lotenum smallint,
    int_idoper integer DEFAULT (-1),
    int_iditem integer DEFAULT (-1),
    int_idsitem integer DEFAULT (-1),
    int_idret integer DEFAULT (-1),
    int_esta integer DEFAULT (-1)
);


ALTER TABLE public.intotal OWNER TO zona;

--
-- Name: intotal_int_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE intotal_int_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.intotal_int_id_seq OWNER TO zona;

--
-- Name: intotal_int_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE intotal_int_id_seq OWNED BY intotal.int_id;



--
-- Name: inventario; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inventario (
    inv_id integer NOT NULL,
    inv_idfm integer,
    inv_nro integer,
    inv_item character varying(150),
    inv_marca character varying(150),
    inv_descripcion character varying(150),
    inv_estadogral character varying(150),
    inv_cantidad numeric(15,2),
    inv_reviso integer,
    inv_controlo integer,
    inv_fecreg timestamp without time zone DEFAULT now(),
    inv_estado integer DEFAULT 1,
    inv_mes integer DEFAULT date_part('month'::text, (now())::date),
    inv_anio integer DEFAULT date_part('year'::text, (now())::date),
    inv_fecha date
);


ALTER TABLE public.inventario OWNER TO zona;

--
-- Name: inventario_inv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inventario_inv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventario_inv_id_seq OWNER TO zona;

--
-- Name: inventario_inv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inventario_inv_id_seq OWNED BY inventario.inv_id;



--
-- Name: inversiones; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE inversiones (
    iv_id integer NOT NULL,
    iv_codigo character varying(20),
    iv_descripcion character varying(144),
    iv_concepto integer DEFAULT 1,
    iv_identificacion integer DEFAULT 1,
    iv_nroexp character varying(15),
    iv_objprod character varying(100),
    iv_vidautil integer,
    iv_vidarem integer,
    iv_valorref numeric(15,0) DEFAULT NULL::numeric,
    iv_fechaini date DEFAULT date(now()),
    iv_meshab integer,
    iv_aniohab integer,
    iv_tipohab character varying(1),
    iv_calle character varying(50),
    iv_nro character varying(10),
    iv_piso character varying(8),
    iv_localidad character varying(20),
    iv_codpos character varying(8),
    iv_provin integer,
    iv_fecreg timestamp without time zone DEFAULT now(),
    iv_estado integer DEFAULT 1
);


ALTER TABLE public.inversiones OWNER TO zona;

--
-- Name: inversiones_iv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE inversiones_iv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inversiones_iv_id_seq OWNER TO zona;

--
-- Name: inversiones_iv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE inversiones_iv_id_seq OWNED BY inversiones.iv_id;



--
-- Name: invsistemas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE invsistemas (
    is_id integer NOT NULL,
    is_ubicacion text NOT NULL,
    is_iditem integer NOT NULL,
    is_canti numeric(15,2),
    is_fecha date DEFAULT now(),
    is_obs text,
    is_estado integer DEFAULT 1
);


ALTER TABLE public.invsistemas OWNER TO zona;

--
-- Name: invsistemas_is_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE invsistemas_is_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.invsistemas_is_id_seq OWNER TO zona;

--
-- Name: invsistemas_is_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE invsistemas_is_id_seq OWNED BY invsistemas.is_id;



--
-- Name: item; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE item (
    item_id integer NOT NULL,
    item_idoper integer NOT NULL,
    item_item smallint DEFAULT 1 NOT NULL,
    item_existe_sitem smallint DEFAULT 0 NOT NULL,
    item_moneda smallint,
    item_tipprod integer,
    item_unimed smallint,
    item_posa character varying(15) DEFAULT 'DESCONOCIDA'::character varying,
    item_bloqueado smallint DEFAULT 1,
    item_paisorigen smallint,
    item_proced smallint,
    item_tipitem character(1),
    item_insimptemp numeric(15,2),
    item_insimpcons numeric(10,2),
    item_tipprodint integer
);


ALTER TABLE public.item OWNER TO zona;

--
-- Name: item_item_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE item_item_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.item_item_id_seq OWNER TO zona;

--
-- Name: item_item_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE item_item_id_seq OWNED BY item.item_id;



--
-- Name: itemcarga; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE itemcarga (
    ic_id integer NOT NULL,
    ic_idcarga integer NOT NULL,
    ic_idact integer,
    ic_valor integer,
    ic_obs text,
    ic_estado integer DEFAULT 1
);


ALTER TABLE public.itemcarga OWNER TO zona;

--
-- Name: itemcarga_ic_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE itemcarga_ic_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.itemcarga_ic_id_seq OWNER TO zona;

--
-- Name: itemcarga_ic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE itemcarga_ic_id_seq OWNED BY itemcarga.ic_id;


--
-- Name: itemencuesta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE itemencuesta (
    ie_id integer NOT NULL,
    ie_idencuesta integer,
    ie_orden integer,
    ie_rubro character varying(180),
    ie_tipo integer,
    ie_nombre character varying(380),
    ie_estado integer DEFAULT 1
);


ALTER TABLE public.itemencuesta OWNER TO zona;

--
-- Name: itemencuesta_ie_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE itemencuesta_ie_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.itemencuesta_ie_id_seq OWNER TO zona;

--
-- Name: itemencuesta_ie_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE itemencuesta_ie_id_seq OWNED BY itemencuesta.ie_id;



--
-- Name: items; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE items (
    items_id integer NOT NULL,
    items_idcaratula integer,
    items_despacho text NOT NULL,
    items_transito text NOT NULL,
    nro_item text,
    tipo_item text,
    posic_arancelaria text,
    fecha_imponible date,
    existencia_subitem text,
    estado_mercaderia text,
    peso_neto_kgr text,
    pais_origen text,
    pais_procedencia text,
    unidad_declarada text,
    cant_declarada text DEFAULT '0'::text,
    monto_fob_divisa text DEFAULT '0'::text,
    monto_fob_dolar text DEFAULT '0'::text,
    numero_subitem text,
    s_monto_fob_dolar text DEFAULT '0'::text,
    s_cant_declarada text DEFAULT '0'::text,
    s_monto_fob_divisa text DEFAULT '0'::text,
    codigo_articulo text,
    marca_articulo text,
    modelo_articulo text,
    descrip_articulo text,
    present_articulo text,
    items_estado smallint DEFAULT 1
);


ALTER TABLE public.items OWNER TO zona;

--
-- Name: items_items_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE items_items_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.items_items_id_seq OWNER TO zona;

--
-- Name: items_items_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE items_items_id_seq OWNED BY items.items_id;



--
-- Name: itemstock; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE itemstock (
    is_id integer NOT NULL,
    is_modsgc integer NOT NULL,
    is_codigo character varying(80) NOT NULL,
    is_nombre text NOT NULL,
    is_stockc numeric(15,2),
    is_umed integer,
    is_estado integer DEFAULT 1
);


ALTER TABLE public.itemstock OWNER TO zona;

--
-- Name: itemstock_is_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE itemstock_is_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.itemstock_is_id_seq OWNER TO zona;

--
-- Name: itemstock_is_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE itemstock_is_id_seq OWNED BY itemstock.is_id;



--
-- Name: juicios; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE juicios (
    j_id integer NOT NULL,
    j_nro integer,
    j_fecreg timestamp without time zone DEFAULT now(),
    j_caratula text,
    j_fecini date,
    j_montod numeric(15,2),
    j_montoec numeric(15,2),
    j_descrip text,
    j_docume text,
    j_moddocum text DEFAULT 0,
    j_fecaud date,
    j_observacion text,
    j_estado integer DEFAULT 0,
    j_tipreg integer NOT NULL,
    j_objeto text,
    j_fecha2 date,
    j_tipaud integer DEFAULT 0,
    j_acciones text,
    j_fin integer,
    j_fuero integer DEFAULT 0,
    j_deptoj integer,
    j_archivo text
);


ALTER TABLE public.juicios OWNER TO zona;

--
-- Name: juicios_j_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE juicios_j_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.juicios_j_id_seq OWNER TO zona;

--
-- Name: juicios_j_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE juicios_j_id_seq OWNED BY juicios.j_id;



--
-- Name: juzgados; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE juzgados (
    j_id integer NOT NULL,
    j_nombre character varying(380) NOT NULL,
    j_estado integer DEFAULT 1
);


ALTER TABLE public.juzgados OWNER TO zona;

--
-- Name: juzgados_j_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE juzgados_j_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.juzgados_j_id_seq OWNER TO zona;

--
-- Name: juzgados_j_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE juzgados_j_id_seq OWNED BY juzgados.j_id;


--
-- Name: juzgprov_jp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE juzgprov_jp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.juzgprov_jp_id_seq OWNER TO zona;


--
-- Name: juzgprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE juzgprov (
    jp_id integer DEFAULT nextval('juzgprov_jp_id_seq'::regclass) NOT NULL,
    jp_idfm integer NOT NULL,
    jp_idoperad integer NOT NULL,
    jp_ideval integer NOT NULL,
    jp_fundamentacion text,
    jp_estado numeric DEFAULT 1 NOT NULL,
    jp_nota numeric,
    jp_fecha date,
    jp_rubro character varying(100)
);


ALTER TABLE public.juzgprov OWNER TO zona;

--
-- Name: lecting; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE lecting (
    let_id integer NOT NULL,
    let_placa integer NOT NULL,
    let_barrera integer NOT NULL,
    let_tarje integer NOT NULL,
    let_fecha character varying(40),
    let_fecin timestamp without time zone DEFAULT now(),
    let_estado smallint DEFAULT 1
);


ALTER TABLE public.lecting OWNER TO zona;

--
-- Name: lecting_fallas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE lecting_fallas (
    let_id integer NOT NULL,
    let_placa integer,
    let_barrera integer,
    let_tarje integer,
    let_fecha timestamp without time zone
);


ALTER TABLE public.lecting_fallas OWNER TO zona;

--
-- Name: lecting_fallas_let_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE lecting_fallas_let_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.lecting_fallas_let_id_seq OWNER TO zona;

--
-- Name: lecting_fallas_let_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE lecting_fallas_let_id_seq OWNED BY lecting_fallas.let_id;


--
-- Name: lecting_let_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE lecting_let_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.lecting_let_id_seq OWNER TO zona;

--
-- Name: lecting_let_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE lecting_let_id_seq OWNED BY lecting.let_id;


--
-- Name: leyenrexp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE leyenrexp (
    leyr_id integer NOT NULL,
    leyr_idoper integer NOT NULL,
    leyr_nro smallint,
    leyr_leyenda character varying(360)
);


ALTER TABLE public.leyenrexp OWNER TO zona;

--
-- Name: leyenrexp_leyr_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE leyenrexp_leyr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.leyenrexp_leyr_id_seq OWNER TO zona;

--
-- Name: leyenrexp_leyr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE leyenrexp_leyr_id_seq OWNED BY leyenrexp.leyr_id;


--
-- Name: limpbal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE limpbal (
    lb_id integer NOT NULL,
    lb_fecreg timestamp without time zone DEFAULT now(),
    lb_fechad date,
    lb_fechah date,
    lb_archivo text,
    lb_observacion text,
    lb_estado integer DEFAULT 1,
    lb_balanza text
);


ALTER TABLE public.limpbal OWNER TO zona;

--
-- Name: limpbal_lb_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE limpbal_lb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.limpbal_lb_id_seq OWNER TO zona;

--
-- Name: limpbal_lb_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE limpbal_lb_id_seq OWNED BY limpbal.lb_id;


--
-- Name: listpre; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE listpre (
    ltp_id integer NOT NULL,
    ltp_idcli integer,
    ltp_idart integer NOT NULL,
    ltp_orden integer,
    ltp_precio numeric(15,5) DEFAULT 0
);


ALTER TABLE public.listpre OWNER TO zona;

--
-- Name: listpre_ltp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE listpre_ltp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.listpre_ltp_id_seq OWNER TO zona;

--
-- Name: listpre_ltp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE listpre_ltp_id_seq OWNED BY listpre.ltp_id;


--
-- Name: livianos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE livianos (
    lv_id integer NOT NULL,
    lv_patente character varying(40),
    lv_gente integer,
    lv_marca integer,
    lv_modelo integer,
    lv_anio smallint,
    lv_motor character varying(60),
    lv_chassis character varying(60),
    lv_color character varying(60),
    lv_estado smallint DEFAULT 1,
    lv_obs text
);


ALTER TABLE public.livianos OWNER TO zona;

--
-- Name: livianos_lv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE livianos_lv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.livianos_lv_id_seq OWNER TO zona;

--
-- Name: livianos_lv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE livianos_lv_id_seq OWNED BY livianos.lv_id;


--
-- Name: llamada_llam_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE llamada_llam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llamada_llam_id_seq OWNER TO zona;


--
-- Name: llamada; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE llamada (
    llam_id integer DEFAULT nextval('llamada_llam_id_seq'::regclass) NOT NULL,
    llam_llamante character varying(80),
    llam_llamado integer NOT NULL,
    llam_motivo text,
    llam_estado smallint DEFAULT 1,
    llam_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    llam_operador character varying(40),
    llam_leido timestamp without time zone,
    llam_contacto character varying(80),
    llam_fecha date,
    llam_hora character varying(6),
    llam_numero integer,
    llam_anio integer,
    llam_empresa character varying(70)
);


ALTER TABLE public.llamada OWNER TO zona;

--
-- Name: loginattempt; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE loginattempt (
    lg_id integer NOT NULL,
    lg_operad integer DEFAULT 1,
    lg_dia date DEFAULT date(now()),
    lg_hora character varying(2) DEFAULT date_part('hour'::text, now()),
    lg_fecreg timestamp without time zone DEFAULT now(),
    lg_estado integer DEFAULT 1
);


ALTER TABLE public.loginattempt OWNER TO zona;

--
-- Name: loginattempt_lg_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE loginattempt_lg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.loginattempt_lg_id_seq OWNER TO zona;

--
-- Name: loginattempt_lg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE loginattempt_lg_id_seq OWNED BY loginattempt.lg_id;



--
-- Name: lotes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE lotes (
    lot_id integer NOT NULL,
    lot_codseccion smallint,
    lot_codmza smallint,
    lot_codigo smallint NOT NULL,
    lot_nombre character varying(40),
    lot_supcub numeric(15,5) DEFAULT 0,
    lot_suplib numeric(15,5) DEFAULT 1,
    lot_estado integer,
    lot_tipo smallint,
    lot_superf numeric(15,5) DEFAULT 0,
    lot_direcc character varying(350),
    lot_subt character varying(80)
);


ALTER TABLE public.lotes OWNER TO zona;


--
-- Name: lotes1; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE lotes1 (
    lot1_id integer NOT NULL,
    lot1_codseccion smallint,
    lot1_codmza smallint,
    lot1_codigo smallint NOT NULL,
    lot1_nombre character varying(40),
    lot1_supcub numeric(15,5) DEFAULT 0,
    lot1_suplib numeric(15,5) DEFAULT 1,
    lot1_estado integer,
    lot1_tipo smallint,
    lot1_superf numeric(15,5) DEFAULT 0
);


ALTER TABLE public.lotes1 OWNER TO zona;

--
-- Name: lotes1_lot1_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE lotes1_lot1_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.lotes1_lot1_id_seq OWNER TO zona;

--
-- Name: lotes1_lot1_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE lotes1_lot1_id_seq OWNED BY lotes1.lot1_id;


--
-- Name: lotes_lot_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE lotes_lot_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.lotes_lot_id_seq OWNER TO zona;

--
-- Name: lotes_lot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE lotes_lot_id_seq OWNED BY lotes.lot_id;


--
-- Name: m_astoctas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_astoctas (
    comprob character varying,
    numero integer,
    orden integer,
    ctacble integer,
    ccos character varying,
    fecvto character varying,
    fecval character varying,
    ctacte character varying,
    tipcta character varying,
    nucheq character varying,
    cierra character varying,
    moneda character varying,
    valor character varying,
    importe numeric(15,2),
    idptov integer,
    idastoh integer,
    cotiza numeric(15,5) DEFAULT 0,
    grupo integer DEFAULT 1,
    tasa numeric(15,5) DEFAULT 99,
    idctacte integer,
    idtipcta integer,
    idctacble integer,
    idastoc integer,
    idpropio integer NOT NULL,
    nrorden integer
);


ALTER TABLE public.m_astoctas OWNER TO zona;

--
-- Name: m_astoctas_idpropio_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE m_astoctas_idpropio_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.m_astoctas_idpropio_seq OWNER TO zona;

--
-- Name: m_astoctas_idpropio_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE m_astoctas_idpropio_seq OWNED BY m_astoctas.idpropio;


--
-- Name: m_astoh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_astoh (
    comprob character varying(40) NOT NULL,
    compnro integer NOT NULL,
    empresa smallint,
    division smallint,
    compfec character varying(40),
    descri character varying(40),
    fecval character varying(40),
    tipcl character varying(40),
    fecreg character varying(40),
    tip smallint NOT NULL,
    nro2 character varying(40),
    idcomp integer,
    anio smallint,
    mes smallint,
    idcpra integer,
    idemiti integer
);


ALTER TABLE public.m_astoh OWNER TO zona;

--
-- Name: m_cheques; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_cheques (
    nucheq integer NOT NULL,
    codigo character varying(40),
    numero integer,
    codbco smallint NOT NULL,
    estado smallint,
    fecheq character varying(40),
    codent character varying(40),
    nument character varying(40),
    import numeric(15,2),
    tip smallint,
    tipent character varying(40),
    astoc integer,
    astoce integer
);


ALTER TABLE public.m_cheques OWNER TO zona;

--
-- Name: m_clientes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_clientes (
    codigo integer NOT NULL,
    nombre character varying(40) NOT NULL,
    fantasy character varying(40) NOT NULL,
    coniva smallint,
    nrcuit character varying(40),
    nomabre character varying(40),
    tipcli smallint,
    saldo numeric(15,2),
    limcred numeric(15,2),
    no1 character varying(40),
    no2 character varying(40),
    no3 character varying(40),
    grupo integer,
    conpag integer,
    catego integer,
    no4 character varying(40),
    no5 character varying(40),
    interes character varying(40)
);


ALTER TABLE public.m_clientes OWNER TO zona;

--
-- Name: m_compra; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_compra (
    tip integer,
    comprob character varying(40) NOT NULL,
    compnro integer NOT NULL,
    lecomp character varying(4),
    sucomp integer,
    nucomp integer,
    codcli character varying(40),
    fecha character varying(40),
    fecval character varying(40),
    total numeric(15,2) DEFAULT 0,
    idastoh integer,
    idcomp integer,
    idcli integer
);


ALTER TABLE public.m_compra OWNER TO zona;

--
-- Name: m_compra2; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_compra2 (
    codigo character varying(4),
    numero integer,
    orden smallint,
    tasa numeric,
    ctacble integer,
    ctacte character varying(40),
    importe numeric(15,2),
    idctacble integer,
    idastoc integer,
    idastoh integer
);


ALTER TABLE public.m_compra2 OWNER TO zona;

--
-- Name: m_compra3; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_compra3 (
    codigo character varying(4),
    numero integer,
    nombre character varying(40),
    coniva smallint,
    nrcuit character varying(40),
    idastoh integer,
    idastoc integer
);


ALTER TABLE public.m_compra3 OWNER TO zona;

--
-- Name: m_ctacte; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_ctacte (
    tip smallint,
    codcli integer,
    codigo character varying(40),
    numero integer,
    fecha character varying(40),
    importe numeric(15,2),
    grupo integer,
    cierra character varying(4),
    idastoh integer,
    idastoc integer,
    idpct integer NOT NULL,
    newidastc integer
);


ALTER TABLE public.m_ctacte OWNER TO zona;

--
-- Name: m_ctacte_idpct_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE m_ctacte_idpct_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.m_ctacte_idpct_seq OWNER TO zona;

--
-- Name: m_ctacte_idpct_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE m_ctacte_idpct_seq OWNED BY m_ctacte.idpct;


--
-- Name: m_ctaprove; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_ctaprove (
    tip smallint,
    prove integer,
    codigo character varying(40),
    numero integer,
    fecha character varying(40),
    importe numeric(15,2),
    grupo integer,
    cierra character varying(4),
    idastoh integer,
    idastoc integer
);


ALTER TABLE public.m_ctaprove OWNER TO zona;

--
-- Name: m_difer; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_difer (
    tip integer,
    codigo character varying(40),
    numero integer,
    dif1 character varying(40),
    dif2 character varying(40),
    dif3 character varying(40),
    dif4 character varying(40),
    dif5 character varying(40),
    astoc integer,
    astoce integer
);


ALTER TABLE public.m_difer OWNER TO zona;

--
-- Name: m_emiti; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_emiti (
    tip integer NOT NULL,
    comprob character varying(40) NOT NULL,
    compnro integer NOT NULL,
    codcli integer,
    fecval character varying(40),
    grupo integer,
    conpag integer,
    total numeric(15,2) DEFAULT 0,
    no1 character varying(40),
    no2 character varying(40),
    no3 character varying(40),
    no4 character varying(40),
    no5 character varying(40),
    provin character varying(40),
    retiro character varying(40),
    idcli integer,
    idcomp integer,
    idastoh integer
);


ALTER TABLE public.m_emiti OWNER TO zona;

--
-- Name: m_emiti2; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_emiti2 (
    codigo character varying(4),
    numero integer,
    orden smallint,
    tasa character varying(40),
    ctacble integer,
    ctacte character varying(40),
    importe numeric(15,2),
    ptovta integer,
    idctacble integer,
    idastoc integer,
    idastoh integer
);


ALTER TABLE public.m_emiti2 OWNER TO zona;

--
-- Name: m_emiti3; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_emiti3 (
    codigo character varying(4),
    numero integer,
    orden smallint,
    leyenda character varying(40),
    nombre character varying(40),
    coniva character varying(40),
    nrcuit character varying(40),
    ptovta character varying(40),
    idastoh integer,
    idastoc integer
);


ALTER TABLE public.m_emiti3 OWNER TO zona;

--
-- Name: m_movsto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_movsto (
    codigo character varying,
    numero integer,
    codpro integer,
    destino integer,
    fecval character varying,
    fecrep character varying,
    dias numeric(15,2) DEFAULT 0,
    canti numeric(15,5) DEFAULT 0,
    precio numeric(15,2) DEFAULT 0,
    origen character varying,
    no character varying,
    tip character varying,
    estado character varying,
    ptovta integer,
    codcli integer,
    idastoh integer,
    idemiti integer,
    idartic integer,
    idcomp integer
);


ALTER TABLE public.m_movsto OWNER TO zona;

--
-- Name: m_pctacte; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_pctacte (
    tip smallint,
    codcli integer,
    codigo character varying(40),
    numero integer,
    fecha character varying(40),
    importe numeric(15,2),
    grupo integer,
    cierra character varying(4),
    idastoh integer,
    idastoc integer,
    idpct integer NOT NULL,
    newidastc integer
);


ALTER TABLE public.m_pctacte OWNER TO zona;

--
-- Name: m_pctacte_idpct_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE m_pctacte_idpct_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.m_pctacte_idpct_seq OWNER TO zona;

--
-- Name: m_pctacte_idpct_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE m_pctacte_idpct_seq OWNED BY m_pctacte.idpct;


--
-- Name: m_sucursal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_sucursal (
    codigo integer NOT NULL,
    orden integer,
    direcc character varying(40),
    locali character varying(40),
    codpos character varying(15),
    contacto character varying(40),
    provinc character varying(15),
    repres character varying(40),
    sucu_observ text
);


ALTER TABLE public.m_sucursal OWNER TO zona;

--
-- Name: m_talon; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE m_talon (
    codigo integer NOT NULL,
    nombre character varying(40),
    fecha character varying(40),
    vald integer,
    valh integer,
    idptov integer,
    comprob integer
);


ALTER TABLE public.m_talon OWNER TO zona;


--
-- Name: manzana; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE manzana (
    mza_codigo smallint NOT NULL,
    mza_codseccion smallint NOT NULL,
    mza_nombre character varying(40) NOT NULL
);


ALTER TABLE public.manzana OWNER TO zona;

--
-- Name: marauto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE marauto (
    mar_codigo integer NOT NULL,
    mar_nombre character varying(60) NOT NULL
);


ALTER TABLE public.marauto OWNER TO zona;

--
-- Name: marcont; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE marcont (
    marc_codigo integer NOT NULL,
    marc_descrip character(4) NOT NULL
);


ALTER TABLE public.marcont OWNER TO zona;

--
-- Name: marcont_marc_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE marcont_marc_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.marcont_marc_codigo_seq OWNER TO zona;

--
-- Name: marcont_marc_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE marcont_marc_codigo_seq OWNED BY marcont.marc_codigo;



--
-- Name: medinst; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE medinst (
    mi_id integer NOT NULL,
    mi_idfm integer,
    mi_idinst integer,
    mi_fecha1 date,
    mi_fecha2 date,
    mi_empresa character varying(150),
    mi_trabajos text,
    mi_resultado character varying(100),
    mi_obs text,
    mi_estado integer DEFAULT 1,
    mi_file text
);


ALTER TABLE public.medinst OWNER TO zona;

--
-- Name: medinst_mi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE medinst_mi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.medinst_mi_id_seq OWNER TO zona;

--
-- Name: medinst_mi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE medinst_mi_id_seq OWNED BY medinst.mi_id;



--
-- Name: medpag; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE medpag (
    mpp_codigo integer NOT NULL,
    mpp_nombre character varying(140) NOT NULL,
    mpp_afip integer
);


ALTER TABLE public.medpag OWNER TO zona;


--
-- Name: medpagprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE medpagprov (
    mp_id integer NOT NULL,
    mp_idprov integer DEFAULT 1,
    mp_idmedpag integer DEFAULT 1,
    mp_estado smallint DEFAULT 1
);


ALTER TABLE public.medpagprov OWNER TO zona;

--
-- Name: medpagprov_mp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE medpagprov_mp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.medpagprov_mp_id_seq OWNER TO zona;

--
-- Name: medpagprov_mp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE medpagprov_mp_id_seq OWNED BY medpagprov.mp_id;


--
-- Name: menues; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE menues (
    men_id integer NOT NULL,
    men_titulo text NOT NULL,
    men_tipo smallint DEFAULT 1,
    men_idmenu integer,
    men_estado smallint DEFAULT 1,
    men_alias text,
    men_orden integer
);


ALTER TABLE public.menues OWNER TO zona;

--
-- Name: menues_men_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE menues_men_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.menues_men_id_seq OWNER TO zona;

--
-- Name: menues_men_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE menues_men_id_seq OWNED BY menues.men_id;



--
-- Name: mercaestad; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE mercaestad (
    mestad_codigo integer NOT NULL,
    mestad_descrip character varying(40) NOT NULL
);


ALTER TABLE public.mercaestad OWNER TO zona;


--
-- Name: meses; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE meses (
    m_id integer NOT NULL,
    m_numero integer NOT NULL,
    m_nombre character varying(80),
    m_estado integer DEFAULT 1
);


ALTER TABLE public.meses OWNER TO zona;

--
-- Name: meses_m_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE meses_m_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.meses_m_id_seq OWNER TO zona;

--
-- Name: meses_m_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE meses_m_id_seq OWNED BY meses.m_id;



--
-- Name: minutareunion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE minutareunion (
    m_id integer NOT NULL,
    m_idfm integer,
    m_nro integer NOT NULL,
    m_anio integer NOT NULL,
    m_fecha date NOT NULL,
    m_horaini time without time zone NOT NULL,
    m_horafin time without time zone NOT NULL,
    m_tema text,
    m_confecciono integer,
    m_fecreg timestamp without time zone DEFAULT now(),
    m_ref text,
    m_estado integer DEFAULT 1
);


ALTER TABLE public.minutareunion OWNER TO zona;

--
-- Name: minutareunion_m_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE minutareunion_m_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.minutareunion_m_id_seq OWNER TO zona;

--
-- Name: minutareunion_m_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE minutareunion_m_id_seq OWNED BY minutareunion.m_id;


--
-- Name: modauto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE modauto (
    mod_id integer NOT NULL,
    mod_marca integer NOT NULL,
    mod_nombre character varying(80) NOT NULL
);


ALTER TABLE public.modauto OWNER TO zona;

--
-- Name: modauto_mod_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE modauto_mod_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.modauto_mod_id_seq OWNER TO zona;

--
-- Name: modauto_mod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE modauto_mod_id_seq OWNED BY modauto.mod_id;


--
-- Name: modlogs; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE modlogs (
    log_id integer NOT NULL,
    log_comprob integer,
    log_numero integer,
    log_tabla character varying(60),
    log_idtabla integer DEFAULT 1 NOT NULL,
    log_campo character varying(80),
    log_valant text,
    log_valpos text,
    log_fecha timestamp without time zone DEFAULT now() NOT NULL,
    log_operador integer,
    log_cont integer DEFAULT 1,
    log_leyen text
);


ALTER TABLE public.modlogs OWNER TO zona;

--
-- Name: modlogs_log_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE modlogs_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.modlogs_log_id_seq OWNER TO zona;

--
-- Name: modlogs_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE modlogs_log_id_seq OWNED BY modlogs.log_id;


--
-- Name: modopub; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE modopub (
    mod_id integer NOT NULL,
    mod_idoperador integer,
    mod_idoper integer,
    mod_modalidad smallint DEFAULT 2 NOT NULL,
    mod_idret integer,
    mod_idsitem integer,
    mod_fecha timestamp without time zone DEFAULT now() NOT NULL,
    mod_cantanter numeric(15,5),
    mod_cantnueva numeric(15,5),
    mod_autoriz1 integer,
    mod_fecaut1 timestamp without time zone,
    mod_autoriz2 integer,
    mod_fecaut2 timestamp without time zone,
    mod_autoriz3 integer,
    mod_fecaut3 timestamp without time zone,
    mod_estado smallint DEFAULT 1 NOT NULL,
    mod_texto text
);


ALTER TABLE public.modopub OWNER TO zona;

--
-- Name: modopub_mod_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE modopub_mod_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.modopub_mod_id_seq OWNER TO zona;

--
-- Name: modopub_mod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE modopub_mod_id_seq OWNED BY modopub.mod_id;



--
-- Name: modsgc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE modsgc (
    msc_codigo integer NOT NULL,
    msc_nombre character varying(140) NOT NULL,
    msc_codint character varying(140) NOT NULL
);


ALTER TABLE public.modsgc OWNER TO zona;


--
-- Name: moneda; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE moneda (
    mon_codigo smallint NOT NULL,
    mon_nombre character varying(30) NOT NULL,
    mon_simbol character varying(5)
);


ALTER TABLE public.moneda OWNER TO zona;

--
-- Name: monex; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE monex (
    mne_id integer NOT NULL,
    mne_idastoc integer NOT NULL,
    mne_moneda smallint NOT NULL,
    mne_numero character varying(30),
    mne_valor numeric(15,2),
    mne_estado smallint DEFAULT 1,
    mne_idastoce integer
);


ALTER TABLE public.monex OWNER TO zona;

--
-- Name: monex_mne_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE monex_mne_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.monex_mne_id_seq OWNER TO zona;

--
-- Name: monex_mne_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE monex_mne_id_seq OWNED BY monex.mne_id;



--
-- Name: movssgc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE movssgc (
    ms_id integer NOT NULL,
    ms_iditem integer NOT NULL,
    ms_canti numeric(15,2),
    ms_fecha date,
    ms_obs text,
    ms_estado integer DEFAULT 1
);


ALTER TABLE public.movssgc OWNER TO zona;

--
-- Name: movssgc_ms_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE movssgc_ms_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.movssgc_ms_id_seq OWNER TO zona;

--
-- Name: movssgc_ms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE movssgc_ms_id_seq OWNED BY movssgc.ms_id;



--
-- Name: movsto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE movsto (
    movs_id integer NOT NULL,
    movs_idastoh integer NOT NULL,
    movs_idemiti integer NOT NULL,
    movs_codemp integer NOT NULL,
    movs_idptov integer,
    movs_fecval date,
    movs_artic integer,
    movs_canti numeric(15,5) DEFAULT 0,
    movs_dias numeric(15,2) DEFAULT 0,
    movs_precio numeric(15,2) DEFAULT 0,
    movs_importe numeric(15,2) DEFAULT 0,
    movs_tasa numeric(15,5) DEFAULT 0,
    movs_peso numeric(15,2) DEFAULT 0,
    movs_volum numeric(15,2) DEFAULT 0,
    movs_entreg numeric(15,2) DEFAULT 0,
    movs_fecrep date,
    movs_estado smallint DEFAULT 1,
    movs_codcli integer,
    movs_indir integer,
    movs_clireal integer,
    movs_idoper integer,
    movs_ticket integer,
    movs_leyen text,
    movs_origen integer,
    movs_destino integer,
    movs_compbte character varying(16)
);


ALTER TABLE public.movsto OWNER TO zona;

--
-- Name: movsto_movs_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE movsto_movs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.movsto_movs_id_seq OWNER TO zona;

--
-- Name: movsto_movs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE movsto_movs_id_seq OWNED BY movsto.movs_id;


--
-- Name: movstoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE movstoc (
    movc_id integer NOT NULL,
    movc_idastoh integer NOT NULL,
    movc_idcompra integer NOT NULL,
    movc_codemp integer NOT NULL,
    movc_idptov integer,
    movc_fecval date,
    movc_artic integer,
    movc_canti numeric(15,5) DEFAULT 0,
    movc_precio numeric(15,2) DEFAULT 0,
    movc_importe numeric(15,2) DEFAULT 0,
    movc_tasa numeric(15,5) DEFAULT 0,
    movc_peso numeric(15,2) DEFAULT 0,
    movc_volum numeric(15,2) DEFAULT 0,
    movc_entreg numeric(15,2) DEFAULT 0,
    movc_fecrep date,
    movc_estado smallint DEFAULT 1,
    movc_codpro integer,
    movc_leyen text
);


ALTER TABLE public.movstoc OWNER TO zona;

--
-- Name: movstoc_movc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE movstoc_movc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.movstoc_movc_id_seq OWNER TO zona;

--
-- Name: movstoc_movc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE movstoc_movc_id_seq OWNED BY movstoc.movc_id;


--
-- Name: mpxprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE mpxprov (
    mpxp_prove integer NOT NULL,
    mpxp_fecha date DEFAULT date(now()) NOT NULL,
    mpxp_medpag integer NOT NULL,
    mpxp_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.mpxprov OWNER TO zona;


--
-- Name: notdeb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE notdeb (
    nd_id integer NOT NULL,
    nd_idasho integer NOT NULL,
    nd_codemp integer NOT NULL,
    nd_idptov integer,
    nd_fecval date,
    nd_grupo integer,
    nd_codcli integer,
    nd_estado integer DEFAULT 1,
    nd_tpago numeric(15,2) DEFAULT 0,
    nd_tnd numeric(15,2) DEFAULT 0,
    nd_interes numeric(15,2) DEFAULT 0,
    nd_operadb integer
);


ALTER TABLE public.notdeb OWNER TO zona;

--
-- Name: notdeb_nd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE notdeb_nd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notdeb_nd_id_seq OWNER TO zona;

--
-- Name: notdeb_nd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE notdeb_nd_id_seq OWNED BY notdeb.nd_id;



--
-- Name: noticias; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE noticias (
    not_id integer NOT NULL,
    not_tipo smallint DEFAULT 1 NOT NULL,
    not_numero integer NOT NULL,
    not_texto text,
    not_fecha timestamp without time zone DEFAULT now()
);


ALTER TABLE public.noticias OWNER TO zona;

--
-- Name: noticias_not_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE noticias_not_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.noticias_not_id_seq OWNER TO zona;

--
-- Name: noticias_not_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE noticias_not_id_seq OWNED BY noticias.not_id;



--
-- Name: notifdpzf; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE notifdpzf (
    nd_id integer NOT NULL,
    nd_tipo integer,
    nd_fecdes date,
    nd_fechas date,
    nd_operador integer,
    nd_fecreg timestamp without time zone DEFAULT now(),
    nd_estado integer DEFAULT 1 NOT NULL,
    nd_idtipo integer,
    nd_fecbaja timestamp without time zone,
    nd_operbaja integer
);


ALTER TABLE public.notifdpzf OWNER TO zona;

--
-- Name: notifdpzf_nd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE notifdpzf_nd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notifdpzf_nd_id_seq OWNER TO zona;

--
-- Name: notifdpzf_nd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE notifdpzf_nd_id_seq OWNED BY notifdpzf.nd_id;


--
-- Name: notresp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE notresp (
    nr_id integer NOT NULL,
    nr_fecreg timestamp without time zone DEFAULT now(),
    nr_operad integer DEFAULT 1,
    nr_fecha date,
    nr_fecharesp date,
    nr_destinatario text,
    nr_obs text,
    nr_estado integer DEFAULT 1
);


ALTER TABLE public.notresp OWNER TO zona;

--
-- Name: notresp_nr_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE notresp_nr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.notresp_nr_id_seq OWNER TO zona;

--
-- Name: notresp_nr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE notresp_nr_id_seq OWNED BY notresp.nr_id;


--
-- Name: novemple; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE novemple (
    nv_id integer NOT NULL,
    nv_idemple integer NOT NULL,
    nv_fecha date DEFAULT date(now()) NOT NULL,
    nv_motivo character varying(230),
    nv_obs text,
    nv_autorizado integer,
    nv_estado integer DEFAULT 1,
    nv_codmot integer
);


ALTER TABLE public.novemple OWNER TO zona;

--
-- Name: novemple_nv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE novemple_nv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.novemple_nv_id_seq OWNER TO zona;

--
-- Name: novemple_nv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE novemple_nv_id_seq OWNED BY novemple.nv_id;


--
-- Name: novfact; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE novfact (
    nf_id integer NOT NULL,
    nf_fecdes date,
    nf_fechas date,
    nf_obs text,
    nf_fecreg timestamp without time zone DEFAULT now(),
    nf_estado integer DEFAULT 1,
    nf_usuario integer
);


ALTER TABLE public.novfact OWNER TO zona;

--
-- Name: novfact_nf_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE novfact_nf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.novfact_nf_id_seq OWNER TO zona;

--
-- Name: novfact_nf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE novfact_nf_id_seq OWNED BY novfact.nf_id;


--
-- Name: objcalidad; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE objcalidad (
    o_id integer NOT NULL,
    o_idfm integer,
    o_anio integer NOT NULL,
    o_puntop text,
    o_objgral text,
    o_estado integer DEFAULT 1
);


ALTER TABLE public.objcalidad OWNER TO zona;

--
-- Name: objcalidad_o_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE objcalidad_o_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.objcalidad_o_id_seq OWNER TO zona;

--
-- Name: objcalidad_o_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE objcalidad_o_id_seq OWNED BY objcalidad.o_id;


--
-- Name: objecion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE objecion (
    obj_id integer NOT NULL,
    obj_idoper integer DEFAULT 1,
    obj_motivo text,
    obj_fecobj timestamp without time zone DEFAULT now() NOT NULL,
    obj_operadorid integer,
    obj_estado smallint DEFAULT 1,
    obj_directo integer,
    obj_indirecto integer,
    obj_finalizo integer DEFAULT 1,
    obj_codobj integer,
    obj_observ text
);


ALTER TABLE public.objecion OWNER TO zona;

--
-- Name: objecion_obj_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE objecion_obj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.objecion_obj_id_seq OWNER TO zona;

--
-- Name: objecion_obj_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE objecion_obj_id_seq OWNED BY objecion.obj_id;


--
-- Name: objxacc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE objxacc (
    oa_id integer NOT NULL,
    oa_orden integer,
    oa_idacc integer,
    oa_fecreg timestamp without time zone DEFAULT now(),
    oa_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.objxacc OWNER TO zona;

--
-- Name: objxacc_oa_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE objxacc_oa_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.objxacc_oa_id_seq OWNER TO zona;

--
-- Name: objxacc_oa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE objxacc_oa_id_seq OWNED BY objxacc.oa_id;



--
-- Name: objxplan; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE objxplan (
    obj_id integer NOT NULL,
    obj_idhalla integer,
    obj_idpacch integer,
    obj_objeto character varying(500),
    obj_fecha date NOT NULL,
    obj_obs text,
    obj_estado integer DEFAULT 1
);


ALTER TABLE public.objxplan OWNER TO zona;

--
-- Name: objxplan_obj_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE objxplan_obj_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.objxplan_obj_id_seq OWNER TO zona;

--
-- Name: objxplan_obj_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE objxplan_obj_id_seq OWNED BY objxplan.obj_id;



--
-- Name: obsencuesta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE obsencuesta (
    oe_id integer NOT NULL,
    oe_idenc integer,
    oe_anio integer,
    oe_semestre integer,
    oe_mes integer,
    oe_fecha integer,
    oe_observacion text,
    oe_estado integer DEFAULT 1
);


ALTER TABLE public.obsencuesta OWNER TO zona;

--
-- Name: obsencuesta_oe_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE obsencuesta_oe_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.obsencuesta_oe_id_seq OWNER TO zona;

--
-- Name: obsencuesta_oe_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE obsencuesta_oe_id_seq OWNED BY obsencuesta.oe_id;


--
-- Name: obsindic_obi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE obsindic_obi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.obsindic_obi_id_seq OWNER TO zona;

--
-- Name: obsindic; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE obsindic (
    obi_id integer DEFAULT nextval('obsindic_obi_id_seq'::regclass) NOT NULL,
    obi_modsgc integer NOT NULL,
    obi_idfm integer NOT NULL,
    obi_codind integer NOT NULL,
    obi_observ text,
    obi_fecval date DEFAULT now(),
    obi_operad integer,
    obi_estado integer DEFAULT 1,
    obi_proceso integer NOT NULL
);


ALTER TABLE public.obsindic OWNER TO zona;

--
-- Name: ocb_ocb_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ocb_ocb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ocb_ocb_id_seq OWNER TO zona;


--
-- Name: ocb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ocb (
    ocb_id integer DEFAULT nextval('ocb_ocb_id_seq'::regclass) NOT NULL,
    ocb_idoch integer NOT NULL,
    ocb_articc integer NOT NULL,
    ocb_canti numeric(15,5) DEFAULT 0 NOT NULL,
    ocb_precio numeric(15,5) DEFAULT 0 NOT NULL,
    ocb_unimed integer DEFAULT 7,
    ocb_obs text,
    ocb_cantir numeric(15,5) DEFAULT 0,
    ocb_obsrec text,
    ocb_estado integer DEFAULT 1
);


ALTER TABLE public.ocb OWNER TO zona;

--
-- Name: och_och_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE och_och_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.och_och_id_seq OWNER TO zona;

--
-- Name: och; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE och (
    och_id integer DEFAULT nextval('och_och_id_seq'::regclass) NOT NULL,
    och_idfm integer NOT NULL,
    och_numero integer NOT NULL,
    och_anio integer NOT NULL,
    och_prove integer,
    och_total numeric(15,2),
    och_operadal integer NOT NULL,
    och_fecal timestamp without time zone DEFAULT date(now()) NOT NULL,
    och_fecent date,
    och_obs text,
    och_operadr integer,
    och_fecrec timestamp without time zone,
    och_obsrec text,
    och_idastoh integer,
    och_estado integer DEFAULT 1,
    och_pagada integer DEFAULT 1
);


ALTER TABLE public.och OWNER TO zona;

--
-- Name: opcioncategoria_opc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE opcioncategoria_opc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.opcioncategoria_opc_id_seq OWNER TO zona;


--
-- Name: opcioncategoria; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE opcioncategoria (
    opc_id integer DEFAULT nextval('opcioncategoria_opc_id_seq'::regclass) NOT NULL,
    opc_idfm integer NOT NULL,
    opc_idcategoria integer NOT NULL,
    opc_nombre character varying(150) NOT NULL,
    opc_peso numeric DEFAULT 0 NOT NULL
);


ALTER TABLE public.opcioncategoria OWNER TO zona;


--
-- Name: operaciones; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE operaciones (
    op_id integer NOT NULL,
    op_tipoper integer NOT NULL,
    op_directo integer NOT NULL,
    op_indirecto integer NOT NULL,
    op_consig integer,
    op_compbte character(16) DEFAULT 'DATO DESCONOCIDO'::bpchar NOT NULL,
    op_comptrans character(16) DEFAULT 'DATO DESCONOCIDO'::bpchar,
    op_fechain date DEFAULT date(now()),
    op_nrotalzon integer NOT NULL,
    op_nrotaldir integer NOT NULL,
    op_estado smallint DEFAULT 11 NOT NULL,
    op_deposito smallint,
    op_conocim character varying(40),
    op_pmedtrans smallint,
    op_canal smallint DEFAULT 1,
    op_iddespach integer,
    op_verificador integer,
    op_volumen numeric(15,5) DEFAULT 0,
    op_peso numeric(15,5) DEFAULT 0,
    op_bultos integer DEFAULT 0,
    op_moneda smallint,
    op_importe numeric(15,2) DEFAULT 0,
    op_impdolar numeric(15,2) DEFAULT 0,
    op_tipo_cambio numeric(15,6) DEFAULT 0,
    op_destino smallint,
    op_proced smallint,
    op_embalaje smallint,
    op_fecha_close date,
    op_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    op_idopw integer DEFAULT 0,
    op_operador integer DEFAULT 0,
    op_vence smallint DEFAULT 1,
    op_reenvasado character varying(16),
    op_fecharec date,
    op_nronota character varying(20),
    op_fechadpfz date,
    op_donacion integer DEFAULT 0,
    op_fechaentregacli date,
    op_fecharecepcli date,
    op_archivo text,
    op_dest integer,
    op_obsr text
);


ALTER TABLE public.operaciones OWNER TO zona;

--
-- Name: operaciones_op_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE operaciones_op_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.operaciones_op_id_seq OWNER TO zona;

--
-- Name: operaciones_op_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE operaciones_op_id_seq OWNED BY operaciones.op_id;


--
-- Name: operadores; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE operadores (
    operad_id integer NOT NULL,
    operad_nombre character varying(40) NOT NULL,
    operad_pass text NOT NULL,
    operad_sector character varying(40),
    operad_estado smallint DEFAULT 1 NOT NULL,
    operad_nivaut1 character(2) DEFAULT 'NO'::bpchar NOT NULL,
    operad_nivaut2 character(2) DEFAULT 'NO'::bpchar NOT NULL,
    operad_count integer DEFAULT 1 NOT NULL,
    operad_grupo smallint,
    operad_cliente smallint,
    operad_login character varying(40) NOT NULL,
    operad_last date DEFAULT date(now()),
    operad_contacto character varying(90),
    operad_telefono character varying(90),
    operad_codemp integer,
    operad_ptovta integer,
    operad_mail text,
    operad_mensaje date,
    operad_redmine integer
);


ALTER TABLE public.operadores OWNER TO zona;

--
-- Name: operadores_operad_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE operadores_operad_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.operadores_operad_id_seq OWNER TO zona;

--
-- Name: operadores_operad_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE operadores_operad_id_seq OWNED BY operadores.operad_id;



--
-- Name: operest; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE operest (
    opr_idoper integer NOT NULL,
    opr_compbte character(16) NOT NULL,
    opr_estado smallint DEFAULT 1 NOT NULL,
    opr_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    opr_fechac timestamp without time zone,
    opr_operador integer
);


ALTER TABLE public.operest OWNER TO zona;


--
-- Name: opervehi; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE opervehi (
    opv_id integer NOT NULL,
    opv_idoper integer,
    opv_pat_chasis character varying(15),
    opv_pat_tractor character varying(15),
    opv_est_camion smallint DEFAULT 0,
    opv_chofer character varying(40),
    opv_codtd character varying(5),
    opv_nro_doc integer,
    opv_fecha_ing timestamp without time zone,
    opv_fecha_egr timestamp without time zone,
    opv_pesa character(1),
    opv_peso_ing numeric(15,5),
    opv_peso_egr numeric(15,5),
    opv_nro_ticket integer,
    opv_obs text,
    opv_fecha_reg timestamp without time zone DEFAULT now() NOT NULL,
    opv_verif integer DEFAULT 1,
    opv_cantv integer,
    opv_inout integer DEFAULT 1,
    opv_remito character varying(40),
    opv_comercio character varying(60),
    opv_unifun integer,
    opv_oper_reg integer,
    opv_fecha_adu timestamp without time zone,
    opv_fecha_adu_sal timestamp without time zone,
    opv_tipo_camion integer,
    opv_idrezago integer,
    opv_idopvin integer,
    opv_idopvout integer
);


ALTER TABLE public.opervehi OWNER TO zona;

--
-- Name: opervehi_opv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE opervehi_opv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.opervehi_opv_id_seq OWNER TO zona;

--
-- Name: opervehi_opv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE opervehi_opv_id_seq OWNED BY opervehi.opv_id;



--
-- Name: ordenpag; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ordenpag (
    orp_idastoh integer NOT NULL,
    orp_texto text,
    orp_importe numeric(15,2) DEFAULT 0
);


ALTER TABLE public.ordenpag OWNER TO zona;


--
-- Name: outgxl; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE outgxl (
    ogxl_iol integer NOT NULL,
    ogxl_io integer NOT NULL,
    ogxl_estado smallint DEFAULT 1
);


ALTER TABLE public.outgxl OWNER TO zona;

--
-- Name: paccb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE paccb (
    pab_id integer NOT NULL,
    pab_idhalla integer,
    pab_idpacch integer,
    pab_idoxp integer,
    pab_accion character varying(500),
    pab_plazo date,
    pab_estado integer DEFAULT 1,
    pab_implem integer DEFAULT 1,
    pab_obs text,
    pab_fecimp date
);


ALTER TABLE public.paccb OWNER TO zona;

--
-- Name: paccb_pab_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE paccb_pab_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.paccb_pab_id_seq OWNER TO zona;

--
-- Name: paccb_pab_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE paccb_pab_id_seq OWNED BY paccb.pab_id;


--
-- Name: pacch; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pacch (
    pah_id integer NOT NULL,
    pah_titulo character varying(500),
    pah_nro integer,
    pah_idhalla integer,
    pah_anio integer,
    pah_mes integer,
    pah_fecha date,
    pah_refer text,
    pah_operad integer,
    pah_fecreg timestamp without time zone DEFAULT now() NOT NULL,
    pah_idfm integer,
    pah_estado integer DEFAULT 1
);


ALTER TABLE public.pacch OWNER TO zona;

--
-- Name: pacch_pah_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pacch_pah_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pacch_pah_id_seq OWNER TO zona;

--
-- Name: pacch_pah_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pacch_pah_id_seq OWNED BY pacch.pah_id;



--
-- Name: padcble; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE padcble (
    pc_id integer NOT NULL,
    pc_idcble integer DEFAULT 1,
    pc_titulo text,
    pc_idptov integer,
    pc_reg integer,
    pc_estado smallint DEFAULT 1,
    pc_modo integer
);


ALTER TABLE public.padcble OWNER TO zona;

--
-- Name: padcble_pc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE padcble_pc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.padcble_pc_id_seq OWNER TO zona;

--
-- Name: padcble_pc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE padcble_pc_id_seq OWNED BY padcble.pc_id;


--
-- Name: pagooc_po_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pagooc_po_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pagooc_po_id_seq OWNER TO zona;


--
-- Name: pagooc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pagooc (
    po_id integer DEFAULT nextval('pagooc_po_id_seq'::regclass) NOT NULL,
    po_idoch integer NOT NULL,
    po_idpag integer NOT NULL,
    po_estado integer DEFAULT 1
);


ALTER TABLE public.pagooc OWNER TO zona;

--
-- Name: pais; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pais (
    pai_codigo smallint NOT NULL,
    pai_nombre character varying(40) NOT NULL
);


ALTER TABLE public.pais OWNER TO zona;


--
-- Name: partesinteresadas; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE partesinteresadas (
    pi_id integer NOT NULL,
    pi_tipo integer,
    pi_parte text,
    pi_expectativas text,
    pi_proceso text,
    pi_infodoc text,
    pi_operador integer,
    pi_fecreg timestamp without time zone DEFAULT now(),
    pi_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.partesinteresadas OWNER TO zona;

--
-- Name: partesinteresadas_pi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE partesinteresadas_pi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.partesinteresadas_pi_id_seq OWNER TO zona;

--
-- Name: partesinteresadas_pi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE partesinteresadas_pi_id_seq OWNED BY partesinteresadas.pi_id;


--
-- Name: participmr; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE participmr (
    pm_id integer NOT NULL,
    pm_idminuta integer,
    pm_idtema integer,
    pm_nombre character varying(500),
    pm_idemple integer,
    pm_tipo integer,
    pm_obs text,
    pm_estado integer DEFAULT 1
);


ALTER TABLE public.participmr OWNER TO zona;

--
-- Name: participmr_pm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE participmr_pm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.participmr_pm_id_seq OWNER TO zona;

--
-- Name: participmr_pm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE participmr_pm_id_seq OWNED BY participmr.pm_id;


--
-- Name: pasto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pasto (
    p_id integer NOT NULL,
    p_idfm integer,
    p_modo integer,
    p_dow integer,
    p_objetivo integer,
    p_fecreg timestamp without time zone DEFAULT now(),
    p_estado integer DEFAULT 1,
    p_anio integer,
    p_week integer
);


ALTER TABLE public.pasto OWNER TO zona;

--
-- Name: pasto_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pasto_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pasto_p_id_seq OWNER TO zona;

--
-- Name: pasto_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pasto_p_id_seq OWNED BY pasto.p_id;


--
-- Name: pauditado; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pauditado (
    p_id integer NOT NULL,
    p_nombre text,
    p_estado integer DEFAULT 1,
    p_idfm integer
);


ALTER TABLE public.pauditado OWNER TO zona;

--
-- Name: pauditado_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pauditado_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pauditado_p_id_seq OWNER TO zona;

--
-- Name: pauditado_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pauditado_p_id_seq OWNED BY pauditado.p_id;


--
-- Name: pdfcontratos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pdfcontratos (
    pc_id integer NOT NULL,
    pc_dispos character varying(50),
    pc_archivo1 character varying(500),
    pc_archivo2 character varying(500),
    pc_fecreg timestamp without time zone DEFAULT now(),
    pc_estado integer DEFAULT 1,
    pc_locatario integer,
    pc_locador integer
);


ALTER TABLE public.pdfcontratos OWNER TO zona;

--
-- Name: pdfcontratos_pc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pdfcontratos_pc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pdfcontratos_pc_id_seq OWNER TO zona;

--
-- Name: pdfcontratos_pc_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pdfcontratos_pc_id_seq OWNED BY pdfcontratos.pc_id;



--
-- Name: planauditoria; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE planauditoria (
    pa_id integer NOT NULL,
    pa_ids integer,
    pa_mesp integer,
    pa_aniop integer NOT NULL,
    pa_fechar date,
    pa_plan integer,
    pa_realiz integer,
    pa_obs text,
    pa_estado integer DEFAULT 1
);


ALTER TABLE public.planauditoria OWNER TO zona;

--
-- Name: planauditoria_pa_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE planauditoria_pa_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.planauditoria_pa_id_seq OWNER TO zona;

--
-- Name: planauditoria_pa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE planauditoria_pa_id_seq OWNED BY planauditoria.pa_id;



--
-- Name: poderes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE poderes (
    p_id integer NOT NULL,
    p_nro character varying(100),
    p_fecreg timestamp without time zone DEFAULT now(),
    p_titulo text,
    p_fecha date,
    p_de text,
    p_hacia text,
    p_observacion text,
    p_estado integer DEFAULT 1,
    p_archivo text
);


ALTER TABLE public.poderes OWNER TO zona;

--
-- Name: poderes_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE poderes_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.poderes_p_id_seq OWNER TO zona;

--
-- Name: poderes_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE poderes_p_id_seq OWNED BY poderes.p_id;



--
-- Name: posaran; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE posaran (
    posa_codigo character varying(15) NOT NULL,
    posa_nombre character varying(80) NOT NULL
);


ALTER TABLE public.posaran OWNER TO zona;


--
-- Name: posarest; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE posarest (
    posar_codigo character varying(15) NOT NULL,
    posar_desc character varying(200),
    posar_estado smallint DEFAULT 1
);


ALTER TABLE public.posarest OWNER TO zona;

--
-- Name: ppuestob; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ppuestob (
    pp_id integer NOT NULL,
    pp_idpc integer,
    pp_codsgc integer,
    pp_descripcion character varying(400),
    pp_valor character varying(50),
    pp_estado integer DEFAULT 1
);


ALTER TABLE public.ppuestob OWNER TO zona;

--
-- Name: ppuestob_pp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ppuestob_pp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ppuestob_pp_id_seq OWNER TO zona;

--
-- Name: ppuestob_pp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ppuestob_pp_id_seq OWNED BY ppuestob.pp_id;



--
-- Name: ppuestoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ppuestoc (
    pp_id integer NOT NULL,
    pp_idfm integer,
    pp_puesto character varying(80),
    pp_reporta character varying(80),
    pp_aprobo character varying(80),
    pp_fecap date,
    pp_estado integer DEFAULT 1
);


ALTER TABLE public.ppuestoc OWNER TO zona;

--
-- Name: ppuestoc_pp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ppuestoc_pp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ppuestoc_pp_id_seq OWNER TO zona;

--
-- Name: ppuestoc_pp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ppuestoc_pp_id_seq OWNED BY ppuestoc.pp_id;



--
-- Name: presup; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE presup (
    p_id integer NOT NULL,
    p_idrh integer DEFAULT 1,
    p_idprov integer DEFAULT 1,
    p_archivo bytea,
    p_estado smallint DEFAULT 1
);


ALTER TABLE public.presup OWNER TO zona;

--
-- Name: presup_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE presup_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.presup_p_id_seq OWNER TO zona;

--
-- Name: presup_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE presup_p_id_seq OWNED BY presup.p_id;



--
-- Name: problimp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE problimp (
    pim_id integer NOT NULL,
    pim_tipo smallint DEFAULT 1 NOT NULL,
    pim_numero integer NOT NULL,
    pim_texto text,
    pim_fecha timestamp without time zone DEFAULT now()
);


ALTER TABLE public.problimp OWNER TO zona;

--
-- Name: problimp_pim_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE problimp_pim_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.problimp_pim_id_seq OWNER TO zona;

--
-- Name: problimp_pim_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE problimp_pim_id_seq OWNED BY problimp.pim_id;


--
-- Name: proceso_ps_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE proceso_ps_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.proceso_ps_id_seq OWNER TO zona;


--
-- Name: proceso; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE proceso (
    ps_id integer DEFAULT nextval('proceso_ps_id_seq'::regclass) NOT NULL,
    ps_modulo integer NOT NULL,
    ps_codigo character varying(140) NOT NULL,
    ps_nombre character varying(140) NOT NULL,
    ps_orden integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.proceso OWNER TO zona;

--
-- Name: profxinv; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE profxinv (
    pxi_id integer NOT NULL,
    pxi_idinv integer,
    pxi_tipo integer,
    pxi_cuit character varying(13),
    pxi_dictamen character varying(15),
    pxi_fecha date DEFAULT date(now()),
    pxi_jurisd character varying(50),
    pxi_estado integer DEFAULT 1
);


ALTER TABLE public.profxinv OWNER TO zona;

--
-- Name: profxinv_pxi_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE profxinv_pxi_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.profxinv_pxi_id_seq OWNER TO zona;

--
-- Name: profxinv_pxi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE profxinv_pxi_id_seq OWNED BY profxinv.pxi_id;


--
-- Name: proganualsh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE proganualsh (
    pa_id integer NOT NULL,
    pa_idfm integer,
    pa_anio integer,
    pa_mes integer,
    pa_idactividad integer,
    pa_idrp integer,
    pa_obs text,
    pa_planeado integer DEFAULT 1,
    pa_realizado integer DEFAULT 1
);


ALTER TABLE public.proganualsh OWNER TO zona;

--
-- Name: proganualsh_pa_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE proganualsh_pa_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.proganualsh_pa_id_seq OWNER TO zona;

--
-- Name: proganualsh_pa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE proganualsh_pa_id_seq OWNED BY proganualsh.pa_id;


--
-- Name: proginst; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE proginst (
    p_id integer NOT NULL,
    p_idfm integer,
    p_fecha date NOT NULL,
    p_objeto character varying(500),
    p_accion text,
    p_responsables character varying(150),
    p_plazoej character varying(20),
    p_fechaej date,
    p_obs text,
    p_estado integer DEFAULT 1,
    p_alta integer,
    p_baja integer,
    p_social integer DEFAULT 1
);


ALTER TABLE public.proginst OWNER TO zona;

--
-- Name: proginst_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE proginst_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.proginst_p_id_seq OWNER TO zona;

--
-- Name: proginst_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE proginst_p_id_seq OWNED BY proginst.p_id;


--
-- Name: prompag; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE prompag (
    "?column?" date
);


ALTER TABLE public.prompag OWNER TO zona;


--
-- Name: prove; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE prove (
    prov_id integer NOT NULL,
    prov_nrcuit character varying(20),
    prov_codemp integer,
    prov_idptov integer,
    prov_codigo integer,
    prov_nombre character varying(80),
    prov_direcc character varying(150),
    prov_locali character varying(40),
    prov_provin integer DEFAULT 1 NOT NULL,
    prov_pais smallint DEFAULT 200 NOT NULL,
    prov_estado smallint DEFAULT 1 NOT NULL,
    prov_direce character varying(90),
    prov_observ text,
    prov_grupo integer DEFAULT 1,
    prov_tipo integer DEFAULT 1,
    prov_coniva integer DEFAULT 1,
    prov_retig integer DEFAULT 1,
    prov_codpos character varying,
    prov_critico integer DEFAULT 2 NOT NULL,
    prov_conpag integer,
    prov_rubro character varying(40),
    prov_fantasy character varying(300),
    prov_extra integer DEFAULT 2
);


ALTER TABLE public.prove OWNER TO zona;

--
-- Name: prove_prov_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE prove_prov_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.prove_prov_id_seq OWNER TO zona;

--
-- Name: prove_prov_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE prove_prov_id_seq OWNED BY prove.prov_id;


--
-- Name: provin; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE provin (
    pro_codigo integer NOT NULL,
    pro_nombre character varying(40) NOT NULL,
    pro_tasa numeric(15,5),
    pro_coef numeric(15,5),
    pro_valor numeric(15,2) DEFAULT 0,
    pro_afip integer
);


ALTER TABLE public.provin OWNER TO zona;

--
-- Name: provin_pro_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE provin_pro_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.provin_pro_codigo_seq OWNER TO zona;

--
-- Name: provin_pro_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE provin_pro_codigo_seq OWNED BY provin.pro_codigo;


--
-- Name: proyecto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE proyecto (
    p_id integer NOT NULL,
    p_idfm integer,
    p_nro integer,
    p_fechaing date,
    p_fechaini date,
    p_fechafin date,
    p_depto integer,
    p_nombre character varying(350),
    p_ingresoped character varying(150),
    p_archivo character varying(250),
    p_fecreg timestamp without time zone DEFAULT now(),
    p_estado integer DEFAULT 1
);


ALTER TABLE public.proyecto OWNER TO zona;

--
-- Name: proyecto_p_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE proyecto_p_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.proyecto_p_id_seq OWNER TO zona;

--
-- Name: proyecto_p_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE proyecto_p_id_seq OWNED BY proyecto.p_id;



--
-- Name: prueba; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE prueba (
    usu integer DEFAULT 1,
    leye text,
    idcfc integer
);


ALTER TABLE public.prueba OWNER TO zona;


--
-- Name: ptovta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE ptovta (
    ptv_id integer NOT NULL,
    ptv_nombre character varying(40),
    ptv_codemp integer,
    ptv_codigo integer NOT NULL,
    ptv_direcc character varying(60),
    ptv_locali character varying(60),
    ptv_codpos character varying(10),
    ptv_provin integer,
    ptv_pais smallint,
    ptv_estado smallint DEFAULT 1
);


ALTER TABLE public.ptovta OWNER TO zona;

--
-- Name: ptovta_ptv_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE ptovta_ptv_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ptovta_ptv_id_seq OWNER TO zona;

--
-- Name: ptovta_ptv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE ptovta_ptv_id_seq OWNED BY ptovta.ptv_id;


--
-- Name: puertos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE puertos (
    pue_codigo character varying(5) NOT NULL,
    pue_nombre character varying(40) NOT NULL,
    pue_pais smallint
);


ALTER TABLE public.puertos OWNER TO zona;


--
-- Name: pwdxoper; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pwdxoper (
    pxo_id integer NOT NULL,
    pxo_idoperad integer,
    pxo_pass text,
    pxo_hash text,
    pxo_fecreg timestamp without time zone DEFAULT now(),
    pxo_estado integer DEFAULT 1 NOT NULL,
    pxo_login text,
    pxo_cliente integer
);


ALTER TABLE public.pwdxoper OWNER TO zona;

--
-- Name: pwdxoper2; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE pwdxoper2 (
    pxo2_id integer NOT NULL,
    pxo2_idoperad integer,
    pxo2_pass text,
    pxo2_hash text,
    pxo2_login text,
    pxo2_cliente integer,
    pxo2_fecreg timestamp without time zone DEFAULT now(),
    pxo2_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.pwdxoper2 OWNER TO zona;

--
-- Name: pwdxoper2_pxo2_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pwdxoper2_pxo2_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pwdxoper2_pxo2_id_seq OWNER TO zona;

--
-- Name: pwdxoper2_pxo2_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pwdxoper2_pxo2_id_seq OWNED BY pwdxoper2.pxo2_id;


--
-- Name: pwdxoper_pxo_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE pwdxoper_pxo_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.pwdxoper_pxo_id_seq OWNER TO zona;

--
-- Name: pwdxoper_pxo_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE pwdxoper_pxo_id_seq OWNED BY pwdxoper.pxo_id;


--
-- Name: recepcionoch_rch_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE recepcionoch_rch_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recepcionoch_rch_id_seq OWNER TO zona;


--
-- Name: recepcionoch; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE recepcionoch (
    rch_id integer DEFAULT nextval('recepcionoch_rch_id_seq'::regclass) NOT NULL,
    rch_idrxoc integer NOT NULL,
    rch_fecha timestamp without time zone DEFAULT now() NOT NULL,
    rch_idastoh integer,
    rch_estado integer DEFAULT 1,
    rch_cantidad numeric(15,5) NOT NULL,
    rch_idoperad integer,
    rch_fecastoh timestamp without time zone
);


ALTER TABLE public.recepcionoch OWNER TO zona;


--
-- Name: reclamos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE reclamos (
    r_id integer NOT NULL,
    r_idfm integer,
    r_nro integer,
    r_fechaacc date NOT NULL,
    r_fecharec date,
    r_nombre character varying(500),
    r_nrosin integer,
    r_detalle text,
    r_resolucion text,
    r_estado integer DEFAULT 1,
    r_empresa character varying(300)
);


ALTER TABLE public.reclamos OWNER TO zona;

--
-- Name: reclamos_r_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE reclamos_r_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reclamos_r_id_seq OWNER TO zona;

--
-- Name: reclamos_r_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE reclamos_r_id_seq OWNED BY reclamos.r_id;


--
-- Name: reclamosclientes; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE reclamosclientes (
    r_id integer NOT NULL,
    r_idfm integer,
    r_fecha date NOT NULL,
    r_via text,
    r_nombre character varying(500),
    r_objeto text,
    r_atendido text,
    r_resuelto text,
    r_fechares date,
    r_obs text,
    r_estado integer DEFAULT 1
);


ALTER TABLE public.reclamosclientes OWNER TO zona;

--
-- Name: reclamosclientes_r_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE reclamosclientes_r_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reclamosclientes_r_id_seq OWNER TO zona;

--
-- Name: reclamosclientes_r_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE reclamosclientes_r_id_seq OWNED BY reclamosclientes.r_id;


--
-- Name: reclped; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE reclped (
    r_id integer NOT NULL,
    r_idfm integer,
    r_fecha date NOT NULL,
    r_via text,
    r_detalle text,
    r_entidad integer DEFAULT 1,
    r_proced integer DEFAULT 1,
    r_pinteresada text,
    r_atendido text,
    r_resuelto text,
    r_fechares date,
    r_pacch integer,
    r_obs text,
    r_estado integer DEFAULT 1
);


ALTER TABLE public.reclped OWNER TO zona;

--
-- Name: reclped_r_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE reclped_r_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reclped_r_id_seq OWNER TO zona;

--
-- Name: reclped_r_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE reclped_r_id_seq OWNED BY reclped.r_id;



--
-- Name: regcam; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE regcam (
    rg_id integer NOT NULL,
    rg_idinst integer DEFAULT 1,
    rg_idcs integer DEFAULT 1,
    rg_fecha date DEFAULT date(now()),
    rg_mes integer,
    rg_anio integer,
    rg_fecreg timestamp without time zone DEFAULT now(),
    rg_estado integer DEFAULT 1,
    rg_obs text
);


ALTER TABLE public.regcam OWNER TO zona;

--
-- Name: regcam_rg_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE regcam_rg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.regcam_rg_id_seq OWNER TO zona;

--
-- Name: regcam_rg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE regcam_rg_id_seq OWNED BY regcam.rg_id;


--
-- Name: regdoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE regdoc (
    rd_id integer NOT NULL,
    rd_nro integer,
    rd_fecreg timestamp without time zone DEFAULT now(),
    rd_tipdoc integer,
    rd_cliente integer,
    rd_fecvto date,
    rd_archivo text,
    rd_observacion text,
    rd_estado integer DEFAULT 1
);


ALTER TABLE public.regdoc OWNER TO zona;

--
-- Name: regdoc_rd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE regdoc_rd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.regdoc_rd_id_seq OWNER TO zona;

--
-- Name: regdoc_rd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE regdoc_rd_id_seq OWNED BY regdoc.rd_id;


--
-- Name: regfirma; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE regfirma (
    rf_id integer NOT NULL,
    rf_fecreg timestamp without time zone DEFAULT now(),
    rf_usuario integer,
    rf_archivo text,
    rf_estado integer DEFAULT 1
);


ALTER TABLE public.regfirma OWNER TO zona;

--
-- Name: regfirma_rf_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE regfirma_rf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.regfirma_rf_id_seq OWNER TO zona;

--
-- Name: regfirma_rf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE regfirma_rf_id_seq OWNED BY regfirma.rf_id;


--
-- Name: reginf; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE reginf (
    reg_id integer NOT NULL,
    reg_fecha date NOT NULL,
    reg_hora character varying(6),
    reg_receptor smallint NOT NULL,
    reg_destinatario smallint NOT NULL,
    reg_emi_nom character varying(300),
    reg_emi_empresa character varying(300) NOT NULL,
    reg_emi_telefono character varying(15),
    reg_mensaje character varying(3000),
    reg_adjunto character varying(3000) NOT NULL,
    reg_estado smallint DEFAULT 1,
    reg_fecharecib timestamp without time zone DEFAULT now(),
    reg_observaciones text,
    reg_fechadestin timestamp without time zone,
    reg_anio integer,
    reg_numero integer,
    reg_tipnot integer
);


ALTER TABLE public.reginf OWNER TO zona;

--
-- Name: reginf_reg_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE reginf_reg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reginf_reg_id_seq OWNER TO zona;

--
-- Name: reginf_reg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE reginf_reg_id_seq OWNED BY reginf.reg_id;



--
-- Name: regmantenim; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE regmantenim (
    rm_id integer NOT NULL,
    rm_puesto text NOT NULL,
    rm_nrotck integer NOT NULL,
    rm_fecha date,
    rm_obs text,
    rm_estado integer DEFAULT 1
);


ALTER TABLE public.regmantenim OWNER TO zona;

--
-- Name: regmantenim_rm_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE regmantenim_rm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.regmantenim_rm_id_seq OWNER TO zona;

--
-- Name: regmantenim_rm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE regmantenim_rm_id_seq OWNED BY regmantenim.rm_id;


--
-- Name: regmoddom; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE regmoddom (
    rmd_id integer NOT NULL,
    rmd_usuario integer NOT NULL,
    rmd_fecreg timestamp without time zone DEFAULT now(),
    rmd_estado integer DEFAULT 1
);


ALTER TABLE public.regmoddom OWNER TO zona;

--
-- Name: regmoddom_rmd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE regmoddom_rmd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.regmoddom_rmd_id_seq OWNER TO zona;

--
-- Name: regmoddom_rmd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE regmoddom_rmd_id_seq OWNED BY regmoddom.rmd_id;


--
-- Name: relmenu; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE relmenu (
    rmen_id integer NOT NULL,
    rmen_titulo text NOT NULL,
    rmen_link text NOT NULL,
    rmen_tipo smallint DEFAULT 1,
    rmen_idmenu integer,
    rmen_nivel smallint DEFAULT 0,
    rmen_estado smallint DEFAULT 1
);


ALTER TABLE public.relmenu OWNER TO zona;

--
-- Name: relmenu_rmen_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE relmenu_rmen_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.relmenu_rmen_id_seq OWNER TO zona;

--
-- Name: relmenu_rmen_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE relmenu_rmen_id_seq OWNED BY relmenu.rmen_id;


--
-- Name: requeb_rb_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE requeb_rb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.requeb_rb_id_seq OWNER TO zona;


--
-- Name: requeb; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE requeb (
    rb_id integer DEFAULT nextval('requeb_rb_id_seq'::regclass) NOT NULL,
    rb_numero integer NOT NULL,
    rb_idrh integer NOT NULL,
    rb_articc integer NOT NULL,
    rb_cantp numeric(15,5) DEFAULT 0 NOT NULL,
    rb_precio numeric(15,5) DEFAULT 0 NOT NULL,
    rb_unimed integer DEFAULT 7,
    rb_prove integer,
    rb_cantap numeric(15,5),
    rb_cantir numeric(15,5) DEFAULT 0,
    rb_obs text,
    rb_estado integer DEFAULT 1,
    rb_lasign integer
);


ALTER TABLE public.requeb OWNER TO zona;

--
-- Name: requeh_rh_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE requeh_rh_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.requeh_rh_id_seq OWNER TO zona;

--
-- Name: requeh; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE requeh (
    rh_id integer DEFAULT nextval('requeh_rh_id_seq'::regclass) NOT NULL,
    rh_numero integer NOT NULL,
    rh_depto integer,
    rh_operadal integer NOT NULL,
    rh_fecal date DEFAULT date(now()) NOT NULL,
    rh_fecnec date,
    rh_obs text,
    rh_estado integer DEFAULT 1,
    rh_idfm integer NOT NULL,
    rh_feccie timestamp without time zone
);


ALTER TABLE public.requeh OWNER TO zona;


--
-- Name: respxacc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE respxacc (
    rxa_id integer NOT NULL,
    rxa_idhalla integer,
    rxa_idpacch integer,
    rxa_idoxp integer,
    rxa_idpaccb integer,
    rxa_tipo integer,
    rxa_respons integer,
    rxa_estado integer DEFAULT 1,
    rxa_obs text,
    rxa_externo character varying(300)
);


ALTER TABLE public.respxacc OWNER TO zona;

--
-- Name: respxacc_rxa_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE respxacc_rxa_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.respxacc_rxa_id_seq OWNER TO zona;

--
-- Name: respxacc_rxa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE respxacc_rxa_id_seq OWNED BY respxacc.rxa_id;



--
-- Name: resultencuesta; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE resultencuesta (
    re_id integer NOT NULL,
    re_idencuesta integer,
    re_usuario integer,
    re_empleado integer,
    re_proceso integer,
    re_capacitador text,
    re_tematica text,
    re_fecha date NOT NULL,
    re_scan text,
    re_estado integer DEFAULT 1,
    re_operador integer,
    re_resultado numeric(15,2),
    re_nro integer,
    e_usuario character varying(300),
    re_ticket integer,
    re_tipop integer
);


ALTER TABLE public.resultencuesta OWNER TO zona;

--
-- Name: resultencuesta_re_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE resultencuesta_re_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resultencuesta_re_id_seq OWNER TO zona;

--
-- Name: resultencuesta_re_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE resultencuesta_re_id_seq OWNED BY resultencuesta.re_id;


--
-- Name: retiros; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE retiros (
    ret_id integer NOT NULL,
    ret_idopera integer NOT NULL,
    ret_idsitem integer NOT NULL,
    ret_item smallint DEFAULT 1 NOT NULL,
    ret_sitem smallint DEFAULT 0 NOT NULL,
    ret_cantidad numeric(15,5) DEFAULT 0 NOT NULL,
    ret_idsitemc integer,
    ret_itemint integer,
    ret_sitemint integer
);


ALTER TABLE public.retiros OWNER TO zona;

--
-- Name: retiros_ret_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE retiros_ret_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.retiros_ret_id_seq OWNER TO zona;

--
-- Name: retiros_ret_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE retiros_ret_id_seq OWNED BY retiros.ret_id;


--
-- Name: retirosd; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE retirosd (
    retd_id integer NOT NULL,
    retd_idopera integer NOT NULL,
    retd_idsitem integer NOT NULL,
    retd_item smallint DEFAULT 1 NOT NULL,
    retd_sitem smallint DEFAULT 0 NOT NULL,
    retd_cantidad numeric(15,5) DEFAULT 0 NOT NULL,
    retd_idsitemc integer,
    retd_cantdif numeric(15,5) DEFAULT 0 NOT NULL
);


ALTER TABLE public.retirosd OWNER TO zona;

--
-- Name: retirosd_retd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE retirosd_retd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.retirosd_retd_id_seq OWNER TO zona;

--
-- Name: retirosd_retd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE retirosd_retd_id_seq OWNED BY retirosd.retd_id;


--
-- Name: retstock; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE retstock (
    rstk_id integer NOT NULL,
    rstk_idretd integer NOT NULL,
    rstk_idopera integer NOT NULL,
    rstk_idstk integer NOT NULL,
    rstk_item smallint DEFAULT 1 NOT NULL,
    rstk_sitem smallint DEFAULT 0 NOT NULL,
    rstk_cantidad numeric(15,5) DEFAULT 0 NOT NULL,
    rstk_idsitemc integer
);


ALTER TABLE public.retstock OWNER TO zona;

--
-- Name: retstock_rstk_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE retstock_rstk_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.retstock_rstk_id_seq OWNER TO zona;

--
-- Name: retstock_rstk_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE retstock_rstk_id_seq OWNED BY retstock.rstk_id;


--
-- Name: retstock_rstk_idretd_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE retstock_rstk_idretd_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.retstock_rstk_idretd_seq OWNER TO zona;

--
-- Name: retstock_rstk_idretd_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE retstock_rstk_idretd_seq OWNED BY retstock.rstk_idretd;



--
-- Name: reventos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE reventos (
    re_id integer NOT NULL,
    re_fechai date,
    re_horai time without time zone,
    re_descrip text,
    re_disparador text,
    re_solicitud text,
    re_contacto text,
    re_acciones text,
    re_fechaf date,
    re_horaf time without time zone,
    re_obs text,
    re_fecreg timestamp without time zone DEFAULT now(),
    re_estado integer DEFAULT 1
);


ALTER TABLE public.reventos OWNER TO zona;

--
-- Name: reventos_re_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE reventos_re_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.reventos_re_id_seq OWNER TO zona;

--
-- Name: reventos_re_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE reventos_re_id_seq OWNED BY reventos.re_id;



--
-- Name: rezago; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rezago (
    rz_id integer NOT NULL,
    rz_directo integer,
    rz_indirecto integer,
    rz_depo_origen integer,
    rz_depo_dest integer,
    rz_obs text,
    rz_fecha_reg timestamp without time zone DEFAULT now() NOT NULL,
    rz_estado integer DEFAULT 1,
    rz_oper_reg integer,
    rz_numint integer
);


ALTER TABLE public.rezago OWNER TO zona;

--
-- Name: rezago_rz_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rezago_rz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rezago_rz_id_seq OWNER TO zona;

--
-- Name: rezago_rz_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE rezago_rz_id_seq OWNED BY rezago.rz_id;


--
-- Name: rfirma; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rfirma (
    rf_id integer NOT NULL,
    rf_tipo integer DEFAULT 1,
    rf_nombre character varying(300),
    rf_cargo character varying(300),
    rf_tipdoc character varying(5),
    rf_nrodoc integer,
    rf_firma text,
    rf_fecpres date,
    rf_fecbaja date,
    rf_usuario integer,
    rf_fecreg timestamp without time zone DEFAULT now(),
    rf_estado integer DEFAULT 1,
    rf_obs text
);


ALTER TABLE public.rfirma OWNER TO zona;

--
-- Name: rfirma_rf_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rfirma_rf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rfirma_rf_id_seq OWNER TO zona;

--
-- Name: rfirma_rf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE rfirma_rf_id_seq OWNED BY rfirma.rf_id;



--
-- Name: riesgos; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE riesgos (
    r_id integer NOT NULL,
    r_nro integer,
    r_descripcion text,
    r_fecha date,
    r_consideraciones text,
    r_pocurrencia integer,
    r_consecuencia text,
    r_pimpacto integer,
    r_estrategia text,
    r_acciones text,
    r_mecanismos text,
    r_responsables text,
    r_vigente integer,
    r_idpacch integer,
    r_operador integer,
    r_fecreg timestamp without time zone DEFAULT now(),
    r_estado integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.riesgos OWNER TO zona;

--
-- Name: riesgos_r_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE riesgos_r_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.riesgos_r_id_seq OWNER TO zona;

--
-- Name: riesgos_r_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE riesgos_r_id_seq OWNED BY riesgos.r_id;



--
-- Name: rrhhforms; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rrhhforms (
    rh_id integer NOT NULL,
    rh_fecreg timestamp without time zone DEFAULT now(),
    rh_fechad date,
    rh_archivo text,
    rh_observacion text,
    rh_estado integer DEFAULT 1,
    rh_idfm integer
);


ALTER TABLE public.rrhhforms OWNER TO zona;

--
-- Name: rrhhforms_rh_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rrhhforms_rh_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rrhhforms_rh_id_seq OWNER TO zona;

--
-- Name: rrhhforms_rh_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE rrhhforms_rh_id_seq OWNED BY rrhhforms.rh_id;



--
-- Name: rubcomp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rubcomp (
    rcp_codigo integer NOT NULL,
    rcp_nombre character varying(140) NOT NULL
);


ALTER TABLE public.rubcomp OWNER TO zona;

--
-- Name: rubpersonal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rubpersonal (
    rp_id integer NOT NULL,
    rp_nombre text,
    rp_estado integer DEFAULT 1,
    rp_hoja integer
);


ALTER TABLE public.rubpersonal OWNER TO zona;

--
-- Name: rubpersonal_rp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rubpersonal_rp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rubpersonal_rp_id_seq OWNER TO zona;

--
-- Name: rubpersonal_rp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE rubpersonal_rp_id_seq OWNED BY rubpersonal.rp_id;



--
-- Name: rubros; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rubros (
    rub_id integer NOT NULL,
    rub_tipo integer DEFAULT 1,
    rub_codigo integer,
    rub_nombre character varying(30) NOT NULL
);


ALTER TABLE public.rubros OWNER TO zona;

--
-- Name: rubros_rub_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rubros_rub_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rubros_rub_id_seq OWNER TO zona;

--
-- Name: rubros_rub_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE rubros_rub_id_seq OWNED BY rubros.rub_id;



--
-- Name: rubxprov; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rubxprov (
    rxp_prove integer NOT NULL,
    rxp_rubcomp integer NOT NULL
);


ALTER TABLE public.rubxprov OWNER TO zona;

--
-- Name: rxoc_rxoc_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE rxoc_rxoc_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rxoc_rxoc_id_seq OWNER TO zona;


--
-- Name: rxoc; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE rxoc (
    rxoc_id integer DEFAULT nextval('rxoc_rxoc_id_seq'::regclass) NOT NULL,
    rxoc_idoch integer NOT NULL,
    rxoc_idrh integer NOT NULL,
    rxoc_idocb integer NOT NULL,
    rxoc_idrb integer NOT NULL,
    rxoc_lasign integer,
    rxoc_cantas numeric(15,5),
    rxoc_estado integer DEFAULT 1,
    rxoc_precioas numeric(15,2),
    rxoc_cantir numeric(15,5) DEFAULT 0,
    rxoc_cantrec numeric(15,5) DEFAULT 0
);


ALTER TABLE public.rxoc OWNER TO zona;


--
-- Name: salidares; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE salidares (
    sr_id integer NOT NULL,
    sr_idfm integer,
    sr_anio integer,
    sr_fecha date,
    sr_pesoret numeric(15,2),
    sr_obs text,
    sr_estado integer DEFAULT 1,
    sr_numero integer
);


ALTER TABLE public.salidares OWNER TO zona;

--
-- Name: salidares_sr_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE salidares_sr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.salidares_sr_id_seq OWNER TO zona;

--
-- Name: salidares_sr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE salidares_sr_id_seq OWNED BY salidares.sr_id;


--
-- Name: sauditado; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE sauditado (
    s_id integer NOT NULL,
    s_idc integer,
    s_nombre text,
    s_estado integer DEFAULT 1,
    s_idfm integer
);


ALTER TABLE public.sauditado OWNER TO zona;

--
-- Name: sauditado_s_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE sauditado_s_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sauditado_s_id_seq OWNER TO zona;

--
-- Name: sauditado_s_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE sauditado_s_id_seq OWNED BY sauditado.s_id;


--
-- Name: scanfa; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE scanfa (
    sc_idastoh integer NOT NULL,
    sc_tipo integer DEFAULT 1,
    sc_estado integer DEFAULT 1 NOT NULL,
    sc_img bytea,
    sc_archivo integer DEFAULT 1
);


ALTER TABLE public.scanfa OWNER TO zona;


--
-- Name: seccion; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE seccion (
    sec_codigo smallint NOT NULL,
    sec_nombre character varying(40) NOT NULL
);


ALTER TABLE public.seccion OWNER TO zona;

--
-- Name: seguros; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE seguros (
    seg_unifun smallint NOT NULL,
    seg_poliza character varying(40) NOT NULL,
    seg_fechad timestamp without time zone NOT NULL,
    seg_hasta timestamp without time zone NOT NULL,
    seg_importei numeric(15,2) DEFAULT 0,
    seg_importerc numeric(15,2) DEFAULT 0,
    seg_estado smallint DEFAULT 1,
    seg_cia character varying(100),
    seg_moneda smallint DEFAULT 1 NOT NULL,
    seg_impmoncte numeric(15,2) DEFAULT 0
);


ALTER TABLE public.seguros OWNER TO zona;

--
-- Name: seq_logs; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE seq_logs
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.seq_logs OWNER TO zona;

--
-- Name: seq_qpaso; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE seq_qpaso
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.seq_qpaso OWNER TO zona;

--
-- Name: seq_tipl; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE seq_tipl
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.seq_tipl OWNER TO zona;


--
-- Name: sexo; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE sexo (
    sex_codigo integer NOT NULL,
    sex_nombre character varying(280) NOT NULL,
    sex_estado integer DEFAULT 1
);


ALTER TABLE public.sexo OWNER TO zona;

--
-- Name: sexo_sex_codigo_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE sexo_sex_codigo_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sexo_sex_codigo_seq OWNER TO zona;

--
-- Name: sexo_sex_codigo_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE sexo_sex_codigo_seq OWNED BY sexo.sex_codigo;


--
-- Name: sgpasto; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE sgpasto (
    sg_id integer NOT NULL,
    sg_idpasto integer NOT NULL,
    sg_semana integer,
    sg_quincena integer,
    sg_mes integer,
    sg_anio integer,
    sg_accion integer DEFAULT (-1),
    sg_obs text,
    sg_fecreg timestamp without time zone DEFAULT now(),
    sg_estado integer DEFAULT 1
);


ALTER TABLE public.sgpasto OWNER TO zona;

--
-- Name: sgpasto_sg_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE sgpasto_sg_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sgpasto_sg_id_seq OWNER TO zona;

--
-- Name: sgpasto_sg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE sgpasto_sg_id_seq OWNED BY sgpasto.sg_id;



--
-- Name: shforms; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE shforms (
    sh_id integer NOT NULL,
    sh_fecreg timestamp without time zone DEFAULT now(),
    sh_fechad date,
    sh_fechah date,
    sh_objetivo text,
    sh_archivo text,
    sh_observacion text,
    sh_estado integer DEFAULT 1,
    sh_idfm integer
);


ALTER TABLE public.shforms OWNER TO zona;

--
-- Name: shforms_sh_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE shforms_sh_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.shforms_sh_id_seq OWNER TO zona;

--
-- Name: shforms_sh_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE shforms_sh_id_seq OWNED BY shforms.sh_id;



--
-- Name: solserv; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE solserv (
    ss_id integer NOT NULL,
    ss_idoper integer DEFAULT 1,
    ss_idcomis integer,
    ss_idcli integer,
    ss_directo integer DEFAULT 1,
    ss_indirecto integer DEFAULT 1,
    ss_factura integer DEFAULT 1,
    ss_compbte character varying(16) DEFAULT 'DATO DESCONOCIDO'::character varying,
    ss_fechaejec date,
    ss_horaej time without time zone,
    ss_initar time without time zone,
    ss_fintar time without time zone,
    ss_cantpers integer,
    ss_autoelev integer,
    ss_obs text,
    ss_fecreg timestamp without time zone DEFAULT now(),
    ss_estado smallint DEFAULT 1,
    ss_operador integer
);


ALTER TABLE public.solserv OWNER TO zona;

--
-- Name: solserv_ss_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE solserv_ss_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.solserv_ss_id_seq OWNER TO zona;

--
-- Name: solserv_ss_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE solserv_ss_id_seq OWNED BY solserv.ss_id;


--
-- Name: srubpersonal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE srubpersonal (
    srp_id integer NOT NULL,
    srp_idrubp integer,
    srp_nombre text,
    srp_estado integer DEFAULT 1
);


ALTER TABLE public.srubpersonal OWNER TO zona;

--
-- Name: srubpersonal_srp_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE srubpersonal_srp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.srubpersonal_srp_id_seq OWNER TO zona;

--
-- Name: srubpersonal_srp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE srubpersonal_srp_id_seq OWNED BY srubpersonal.srp_id;



--
-- Name: stock; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE stock (
    stk_id integer NOT NULL,
    stk_idsitem integer NOT NULL,
    stk_iditem integer NOT NULL,
    stk_idoper integer,
    stk_codigo smallint DEFAULT 0 NOT NULL,
    stk_artic integer,
    stk_canting numeric(15,5) DEFAULT 0 NOT NULL,
    stk_cantret numeric(15,5) DEFAULT 0,
    stk_cantcomp numeric(15,5) DEFAULT 0,
    stk_cantmala numeric(15,5) DEFAULT 0,
    stk_importe numeric(15,2) DEFAULT 0 NOT NULL,
    stk_imp_dolar numeric(15,2) DEFAULT 0,
    stk_volumen numeric(15,5) DEFAULT 0,
    stk_peso numeric(15,5) DEFAULT 0,
    stk_tipemb smallint,
    stk_deposito smallint,
    stk_idacta integer,
    stk_estado integer DEFAULT 1,
    stk_directo integer NOT NULL,
    stk_indirecto integer NOT NULL,
    stk_compbte character varying(16),
    stk_cliente integer,
    stk_comptras character varying(16)
);


ALTER TABLE public.stock OWNER TO zona;

--
-- Name: subitem; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subitem (
    sitem_id integer NOT NULL,
    sitem_iditem integer NOT NULL,
    sitem_idoper integer,
    sitem_codigo smallint DEFAULT 0 NOT NULL,
    sitem_artic integer,
    sitem_canting numeric(15,5) DEFAULT 0 NOT NULL,
    sitem_cantret numeric(15,5) DEFAULT 0,
    sitem_cantcomp numeric(15,5) DEFAULT 0,
    sitem_cantmala numeric(15,5) DEFAULT 0,
    sitem_importe numeric(15,2) DEFAULT 0 NOT NULL,
    sitem_imp_dolar numeric(15,2) DEFAULT 0,
    sitem_volumen numeric(15,5) DEFAULT 0,
    sitem_peso numeric(15,5) DEFAULT 0,
    sitem_tipemb smallint,
    sitem_deposito smallint,
    sitem_idacta integer,
    sitem_estado integer DEFAULT 1,
    sitem_directo integer NOT NULL,
    sitem_indirecto integer NOT NULL,
    sitem_compbte character varying(16),
    sitem_onu text,
    sitem_itemint integer,
    sitem_sitemint integer
);


ALTER TABLE public.subitem OWNER TO zona;

--
-- Name: stock1; Type: VIEW; Schema: public; Owner: zona
--

CREATE VIEW stock1 AS
    SELECT o.op_directo AS directo, nomusu(o.op_directo) AS nomclid, o.op_indirecto AS indirecto, nomusu(o.op_indirecto) AS nomcli, o.op_compbte AS comprobante, traigo_codarticu(a.sitem_artic) AS traigo_codarticu, traigo_nomarticu(a.sitem_artic) AS traigo_nomarticu, precio_unitario(a.sitem_id) AS precio_unitario, traigo_moneda(a.sitem_iditem) AS traigo_moneda, a.sitem_deposito AS deposito, a.sitem_canting AS ingresada, a.sitem_cantcomp AS comprometida, a.sitem_cantret AS retirada, a.sitem_cantmala AS malacondi, (a.sitem_canting - a.sitem_cantret) AS stock, cantidad_disponible(a.sitem_id) AS disponible, b.item_tipprod AS tipoprod, a.sitem_artic AS articulo FROM operaciones o, subitem a, item b WHERE (((o.op_id = a.sitem_idoper) AND (a.sitem_estado = 1)) AND (a.sitem_iditem = b.item_id));


ALTER TABLE public.stock1 OWNER TO zona;

--
-- Name: stock_stk_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE stock_stk_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.stock_stk_id_seq OWNER TO zona;

--
-- Name: stock_stk_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE stock_stk_id_seq OWNED BY stock.stk_id;


--
-- Name: subd; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subd (
    subd_id integer NOT NULL,
    subd_codemp integer DEFAULT 0 NOT NULL,
    subd_idptov integer DEFAULT 0,
    subd_nombre character varying(40),
    subd_titulo character varying(40),
    subd_fecd date,
    subd_fech date,
    subd_estado smallint DEFAULT 1 NOT NULL,
    subd_proxnum integer
);


ALTER TABLE public.subd OWNER TO zona;

--
-- Name: subd_subd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE subd_subd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subd_subd_id_seq OWNER TO zona;

--
-- Name: subd_subd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE subd_subd_id_seq OWNED BY subd.subd_id;


--
-- Name: subitem_sitem_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE subitem_sitem_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subitem_sitem_id_seq OWNER TO zona;

--
-- Name: subitem_sitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE subitem_sitem_id_seq OWNED BY subitem.sitem_id;


--
-- Name: subitemd; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subitemd (
    sitemd_id integer NOT NULL,
    sitemd_iditem integer NOT NULL,
    sitemd_idoper integer,
    sitemd_codigo smallint DEFAULT 0 NOT NULL,
    sitemd_artic integer,
    sitemd_canting numeric(15,5) DEFAULT 0 NOT NULL,
    sitemd_cantret numeric(15,5) DEFAULT 0,
    sitemd_cantcomp numeric(15,5) DEFAULT 0,
    sitemd_cantmala numeric(15,5) DEFAULT 0,
    sitemd_importe numeric(15,2) DEFAULT 0 NOT NULL,
    sitemd_imp_dolar numeric(15,2) DEFAULT 0,
    sitemd_volumen numeric(15,5) DEFAULT 0,
    sitemd_peso numeric(15,5) DEFAULT 0,
    sitemd_tipemb smallint,
    sitemd_deposito smallint,
    sitemd_idacta integer,
    sitemd_estado integer DEFAULT 1,
    sitemd_directo integer NOT NULL,
    sitemd_indirecto integer NOT NULL,
    sitemd_compbte character varying(16),
    sitemd_cliente integer,
    sitemd_comptras character varying(16),
    sitemd_cantdif numeric(15,5) DEFAULT 0
);


ALTER TABLE public.subitemd OWNER TO zona;

--
-- Name: subitemd_sitemd_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE subitemd_sitemd_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subitemd_sitemd_id_seq OWNER TO zona;

--
-- Name: subitemd_sitemd_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE subitemd_sitemd_id_seq OWNED BY subitemd.sitemd_id;


--
-- Name: subrub; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subrub (
    srb_id integer NOT NULL,
    srb_rubro integer NOT NULL,
    srb_codigo smallint NOT NULL,
    srb_nombre character varying(40) NOT NULL,
    srb_precio numeric(15,2) DEFAULT 0,
    srb_leyen text,
    srb_codtg smallint DEFAULT 1,
    srb_conper smallint DEFAULT 1
);


ALTER TABLE public.subrub OWNER TO zona;

--
-- Name: subrub_srb_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE subrub_srb_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subrub_srb_id_seq OWNER TO zona;

--
-- Name: subrub_srb_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE subrub_srb_id_seq OWNED BY subrub.srb_id;


--
-- Name: subtcontrat; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subtcontrat (
    subt_id integer NOT NULL,
    subt_idtipc integer NOT NULL,
    subt_codigo smallint,
    subt_descrip character(30) NOT NULL,
    art_id integer
);


ALTER TABLE public.subtcontrat OWNER TO zona;

--
-- Name: subtcontrat_subt_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE subtcontrat_subt_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.subtcontrat_subt_id_seq OWNER TO zona;

--
-- Name: subtcontrat_subt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE subtcontrat_subt_id_seq OWNED BY subtcontrat.subt_id;


--
-- Name: subxcomp; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE subxcomp (
    subxc_idsub integer NOT NULL,
    subxc_comprob integer NOT NULL
);


ALTER TABLE public.subxcomp OWNER TO zona;

--
-- Name: sucursal; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE sucursal (
    sucu_cliente integer NOT NULL,
    sucu_codigo smallint DEFAULT 1 NOT NULL,
    sucu_nombre character varying(300) NOT NULL,
    sucu_direcc character varying(150),
    sucu_locali character varying(40),
    sucu_codpos character varying(15),
    sucu_provin integer,
    sucu_pais smallint,
    sucu_repres character varying(40),
    sucu_contacto character varying(40),
    sucu_observ text,
    sucu_direccl character varying(150),
    sucu_localil character varying(40),
    sucu_codposl character varying(15),
    sucu_codprovl integer,
    sucu_paisl smallint,
    sucu_direcco character varying(150),
    sucu_localio character varying(40),
    sucu_codposo character varying(15),
    sucu_codprovo integer,
    sucu_paiso smallint,
    sucu_corresp integer DEFAULT 1,
    sucu_factu integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.sucursal OWNER TO zona;

--
-- Name: sucursales; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE sucursales (
    suc_cliente integer NOT NULL,
    suc_codigo smallint DEFAULT 1 NOT NULL,
    suc_nombre character varying(300) NOT NULL,
    suc_direcc character varying(80),
    suc_locali character varying(40),
    suc_codpos character varying(15),
    suc_codprov integer,
    suc_pais smallint,
    suc_repres character varying(40),
    suc_contacto character varying(40),
    suc_observ text,
    suc_direccl character varying(40),
    suc_localil character varying(40),
    suc_codposl character varying(15),
    suc_codprovl integer,
    suc_paisl smallint
);


ALTER TABLE public.sucursales OWNER TO zona;

--
-- Name: talon; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE talon (
    tal_id integer NOT NULL,
    tal_idptov integer,
    tal_comprob integer,
    tal_nombre character varying(40) NOT NULL,
    tal_valor integer,
    tal_fecha date,
    tal_estado smallint DEFAULT 1,
    tal_vald integer DEFAULT 1,
    tal_valh integer DEFAULT 100000,
    tal_fecvto date DEFAULT '2028-12-31'::date,
    tal_codemp integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.talon OWNER TO zona;

--
-- Name: talon_tal_id_seq; Type: SEQUENCE; Schema: public; Owner: zona
--

CREATE SEQUENCE talon_tal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.talon_tal_id_seq OWNER TO zona;

--
-- Name: talon_tal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: zona
--

ALTER SEQUENCE talon_tal_id_seq OWNED BY talon.tal_id;


--
-- Name: talonop; Type: TABLE; Schema: public; Owner: zona; Tablespace: 
--

CREATE TABLE talonop (
    talop_usuario integer NOT NULL,
    talop_tipoper integer NOT NULL,
    talop_numero integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.talonop OWNER TO zona;

--
