--
--


-- Started on 2020-07-10 13:15:59 CEST


--
-- TOC entry 1 (class 3079 OID 12403)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- TOC entry 6447 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


--
-- TOC entry 654 (class 1255 OID 834460)
-- Name: date_format(timestamp without time zone, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.date_format(timestamp without time zone, text) RETURNS text
    LANGUAGE plpgsql IMMUTABLE STRICT
    AS $_$ DECLARE i int := 1; temp text := ''; c text; n text; res text; BEGIN WHILE i <= pg_catalog.length($2) LOOP c := SUBSTRING ($2 FROM i FOR 1); IF c = '%' AND i != pg_catalog.length($2) THEN n := SUBSTRING ($2 FROM (i + 1) FOR 1); SELECT INTO res CASE WHEN n = 'a' THEN pg_catalog.to_char($1, 'Dy') WHEN n = 'b' THEN pg_catalog.to_char($1, 'Mon') WHEN n = 'c' THEN pg_catalog.to_char($1, 'FMMM') WHEN n = 'D' THEN pg_catalog.to_char($1, 'FMDDth') WHEN n = 'd' THEN pg_catalog.to_char($1, 'DD') WHEN n = 'e' THEN pg_catalog.to_char($1, 'FMDD') WHEN n = 'f' THEN pg_catalog.to_char($1, 'US') WHEN n = 'H' THEN pg_catalog.to_char($1, 'HH24') WHEN n = 'h' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'I' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'i' THEN pg_catalog.to_char($1, 'MI') WHEN n = 'j' THEN pg_catalog.to_char($1, 'DDD') WHEN n = 'k' THEN pg_catalog.to_char($1, 'FMHH24') WHEN n = 'l' THEN pg_catalog.to_char($1, 'FMHH12') WHEN n = 'M' THEN pg_catalog.to_char($1, 'FMMonth') WHEN n = 'm' THEN pg_catalog.to_char($1, 'MM') WHEN n = 'p' THEN pg_catalog.to_char($1, 'AM') WHEN n = 'r' THEN pg_catalog.to_char($1, 'HH12:MI:SS AM') WHEN n = 'S' THEN pg_catalog.to_char($1, 'SS') WHEN n = 's' THEN pg_catalog.to_char($1, 'SS') WHEN n = 'T' THEN pg_catalog.to_char($1, 'HH24:MI:SS') WHEN n = 'U' THEN pg_catalog.to_char($1, '?') WHEN n = 'u' THEN pg_catalog.to_char($1, '?') WHEN n = 'V' THEN pg_catalog.to_char($1, '?') WHEN n = 'v' THEN pg_catalog.to_char($1, '?') WHEN n = 'W' THEN pg_catalog.to_char($1, 'FMDay') WHEN n = 'w' THEN EXTRACT(DOW FROM $1)::text WHEN n = 'X' THEN pg_catalog.to_char($1, '?') WHEN n = 'x' THEN pg_catalog.to_char($1, '?') WHEN n = 'Y' THEN pg_catalog.to_char($1, 'YYYY') WHEN n = 'y' THEN pg_catalog.to_char($1, 'YY') WHEN n = '%' THEN pg_catalog.to_char($1, '%') ELSE NULL END; temp := temp operator(pg_catalog.||) res; i := i + 2; ELSE temp = temp operator(pg_catalog.||) c; i := i + 1; END IF; END LOOP; RETURN temp; END $_$;


ALTER FUNCTION public.date_format(timestamp without time zone, text) OWNER TO postgres;

--
-- TOC entry 655 (class 1255 OID 834461)
-- Name: date_format(timestamp with time zone, text); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.date_format(timestamp with time zone, text) RETURNS text
    LANGUAGE plpgsql IMMUTABLE STRICT
    AS $_$ DECLARE i int := 1; temp text := ''; c text; n text; res text; BEGIN WHILE i <= pg_catalog.length($2) LOOP c := SUBSTRING ($2 FROM i FOR 1); IF c = '%' AND i != pg_catalog.length($2) THEN n := SUBSTRING ($2 FROM (i + 1) FOR 1); SELECT INTO res CASE WHEN n = 'a' THEN pg_catalog.to_char($1, 'Dy') WHEN n = 'b' THEN pg_catalog.to_char($1, 'Mon') WHEN n = 'c' THEN pg_catalog.to_char($1, 'FMMM') WHEN n = 'D' THEN pg_catalog.to_char($1, 'FMDDth') WHEN n = 'd' THEN pg_catalog.to_char($1, 'DD') WHEN n = 'e' THEN pg_catalog.to_char($1, 'FMDD') WHEN n = 'f' THEN pg_catalog.to_char($1, 'US') WHEN n = 'H' THEN pg_catalog.to_char($1, 'HH24') WHEN n = 'h' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'I' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'i' THEN pg_catalog.to_char($1, 'MI') WHEN n = 'j' THEN pg_catalog.to_char($1, 'DDD') WHEN n = 'k' THEN pg_catalog.to_char($1, 'FMHH24') WHEN n = 'l' THEN pg_catalog.to_char($1, 'FMHH12') WHEN n = 'M' THEN pg_catalog.to_char($1, 'FMMonth') WHEN n = 'm' THEN pg_catalog.to_char($1, 'MM') WHEN n = 'p' THEN pg_catalog.to_char($1, 'AM') WHEN n = 'r' THEN pg_catalog.to_char($1, 'HH12:MI:SS AM') WHEN n = 'S' THEN pg_catalog.to_char($1, 'SS') WHEN n = 's' THEN pg_catalog.to_char($1, 'SS') WHEN n = 'T' THEN pg_catalog.to_char($1, 'HH24:MI:SS') WHEN n = 'U' THEN pg_catalog.to_char($1, '?') WHEN n = 'u' THEN pg_catalog.to_char($1, '?') WHEN n = 'V' THEN pg_catalog.to_char($1, '?') WHEN n = 'v' THEN pg_catalog.to_char($1, '?') WHEN n = 'W' THEN pg_catalog.to_char($1, 'FMDay') WHEN n = 'w' THEN EXTRACT(DOW FROM $1)::text WHEN n = 'X' THEN pg_catalog.to_char($1, '?') WHEN n = 'x' THEN pg_catalog.to_char($1, '?') WHEN n = 'Y' THEN pg_catalog.to_char($1, 'YYYY') WHEN n = 'y' THEN pg_catalog.to_char($1, 'YY') WHEN n = '%' THEN pg_catalog.to_char($1, '%') ELSE NULL END; temp := temp operator(pg_catalog.||) res; i := i + 2; ELSE temp = temp operator(pg_catalog.||) c; i := i + 1; END IF; END LOOP; RETURN temp; END $_$;


ALTER FUNCTION public.date_format(timestamp with time zone, text) OWNER TO postgres;

--
-- TOC entry 668 (class 1255 OID 834462)
-- Name: day(date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.day(date) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.day(date) OWNER TO postgres;

--
-- TOC entry 669 (class 1255 OID 834463)
-- Name: day(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.day(timestamp without time zone) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.day(timestamp without time zone) OWNER TO postgres;

--
-- TOC entry 670 (class 1255 OID 834464)
-- Name: day(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.day(timestamp with time zone) RETURNS integer
    LANGUAGE sql STABLE
    AS $_$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.day(timestamp with time zone) OWNER TO postgres;


ALTER FUNCTION public.dol_util_rebuild_sequences() OWNER TO postgres;


ALTER FUNCTION public.dol_util_triggerall(doenable boolean) OWNER TO postgres;

--
-- TOC entry 673 (class 1255 OID 834467)
-- Name: month(date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.month(date) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(MONTH FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.month(date) OWNER TO postgres;

--
-- TOC entry 674 (class 1255 OID 834468)
-- Name: month(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.month(timestamp without time zone) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(MONTH FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.month(timestamp without time zone) OWNER TO postgres;

--
-- TOC entry 675 (class 1255 OID 834469)
-- Name: month(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.month(timestamp with time zone) RETURNS integer
    LANGUAGE sql STABLE
    AS $_$ SELECT EXTRACT(MONTH FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.month(timestamp with time zone) OWNER TO postgres;

--
-- TOC entry 676 (class 1255 OID 834470)
-- Name: unix_timestamp(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.unix_timestamp(timestamp without time zone) RETURNS bigint
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT EXTRACT(EPOCH FROM $1)::bigint;$_$;


ALTER FUNCTION public.unix_timestamp(timestamp without time zone) OWNER TO postgres;

--
-- TOC entry 677 (class 1255 OID 834471)
-- Name: unix_timestamp(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.unix_timestamp(timestamp with time zone) RETURNS bigint
    LANGUAGE sql IMMUTABLE STRICT
    AS $_$SELECT EXTRACT(EPOCH FROM $1)::bigint;$_$;


ALTER FUNCTION public.unix_timestamp(timestamp with time zone) OWNER TO postgres;

--
-- TOC entry 678 (class 1255 OID 834472)
-- Name: update_modified_column_date_m(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.update_modified_column_date_m() RETURNS trigger
    LANGUAGE plpgsql
    AS $$ BEGIN NEW.date_m = now(); RETURN NEW; END; $$;


ALTER FUNCTION public.update_modified_column_date_m() OWNER TO postgres;

--
-- TOC entry 679 (class 1255 OID 834473)
-- Name: update_modified_column_tms(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.update_modified_column_tms() RETURNS trigger
    LANGUAGE plpgsql
    AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$;


ALTER FUNCTION public.update_modified_column_tms() OWNER TO postgres;

--
-- TOC entry 680 (class 1255 OID 834474)
-- Name: year(date); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.year(date) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(YEAR FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.year(date) OWNER TO postgres;

--
-- TOC entry 681 (class 1255 OID 834475)
-- Name: year(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.year(timestamp without time zone) RETURNS integer
    LANGUAGE sql IMMUTABLE
    AS $_$ SELECT EXTRACT(YEAR FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.year(timestamp without time zone) OWNER TO postgres;

--
-- TOC entry 682 (class 1255 OID 834476)
-- Name: year(timestamp with time zone); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.year(timestamp with time zone) RETURNS integer
    LANGUAGE sql STABLE
    AS $_$ SELECT EXTRACT(YEAR FROM $1)::INTEGER; $_$;


ALTER FUNCTION public.year(timestamp with time zone) OWNER TO postgres;



--
-- TOC entry 181 (class 1259 OID 834477)
-- Name: llx_accounting_account; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_account (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_pcg_version character varying(32) NOT NULL,
    pcg_type character varying(20) NOT NULL,
    pcg_subtype character varying(20) NOT NULL,
    account_number character varying(32) NOT NULL,
    account_parent character varying(32) DEFAULT '0'::character varying,
    label character varying(255) NOT NULL,
    fk_accounting_category integer DEFAULT 0,
    fk_user_author integer,
    fk_user_modif integer,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_accounting_account OWNER TO postgres;

--
-- TOC entry 182 (class 1259 OID 834485)
-- Name: llx_accounting_account_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_account_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_account_rowid_seq OWNER TO postgres;

--
-- TOC entry 6448 (class 0 OID 0)
-- Dependencies: 182
-- Name: llx_accounting_account_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_account_rowid_seq OWNED BY public.llx_accounting_account.rowid;


--
-- TOC entry 183 (class 1259 OID 834487)
-- Name: llx_accounting_bookkeeping; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_bookkeeping (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    doc_date date NOT NULL,
    doc_type character varying(30) NOT NULL,
    doc_ref character varying(300) NOT NULL,
    fk_doc integer NOT NULL,
    fk_docdet integer NOT NULL,
    thirdparty_code character varying(32),
    subledger_account character varying(32),
    subledger_label character varying(255),
    numero_compte character varying(32) NOT NULL,
    label_compte character varying(255) NOT NULL,
    label_operation character varying(255),
    debit numeric(24,8) NOT NULL,
    credit numeric(24,8) NOT NULL,
    montant numeric(24,8) NOT NULL,
    sens character varying(1) DEFAULT NULL::character varying,
    multicurrency_amount numeric(24,8),
    multicurrency_code character varying(255),
    lettering_code character varying(255),
    date_lettering timestamp without time zone,
    fk_user_author integer NOT NULL,
    fk_user_modif integer,
    date_creation timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    import_key character varying(14),
    code_journal character varying(32) NOT NULL,
    journal_label character varying(255),
    piece_num integer NOT NULL,
    validated smallint DEFAULT 0 NOT NULL,
    date_validated timestamp without time zone
);


ALTER TABLE public.llx_accounting_bookkeeping OWNER TO postgres;

--
-- TOC entry 184 (class 1259 OID 834497)
-- Name: llx_accounting_bookkeeping_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_bookkeeping_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_bookkeeping_rowid_seq OWNER TO postgres;

--
-- TOC entry 6449 (class 0 OID 0)
-- Dependencies: 184
-- Name: llx_accounting_bookkeeping_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_bookkeeping_rowid_seq OWNED BY public.llx_accounting_bookkeeping.rowid;


--
-- TOC entry 185 (class 1259 OID 834499)
-- Name: llx_accounting_bookkeeping_tmp; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_bookkeeping_tmp (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    doc_date date NOT NULL,
    doc_type character varying(30) NOT NULL,
    doc_ref character varying(300) NOT NULL,
    fk_doc integer NOT NULL,
    fk_docdet integer NOT NULL,
    thirdparty_code character varying(32),
    subledger_account character varying(32),
    subledger_label character varying(255),
    numero_compte character varying(32),
    label_compte character varying(255) NOT NULL,
    label_operation character varying(255),
    debit numeric(24,8) NOT NULL,
    credit numeric(24,8) NOT NULL,
    montant numeric(24,8) NOT NULL,
    sens character varying(1) DEFAULT NULL::character varying,
    multicurrency_amount numeric(24,8),
    multicurrency_code character varying(255),
    lettering_code character varying(255),
    date_lettering timestamp without time zone,
    fk_user_author integer NOT NULL,
    fk_user_modif integer,
    date_creation timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    import_key character varying(14),
    code_journal character varying(32) NOT NULL,
    journal_label character varying(255),
    piece_num integer NOT NULL,
    validated smallint DEFAULT 0 NOT NULL,
    date_validated timestamp without time zone
);


ALTER TABLE public.llx_accounting_bookkeeping_tmp OWNER TO postgres;

--
-- TOC entry 186 (class 1259 OID 834509)
-- Name: llx_accounting_bookkeeping_tmp_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_bookkeeping_tmp_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_bookkeeping_tmp_rowid_seq OWNER TO postgres;

--
-- TOC entry 6450 (class 0 OID 0)
-- Dependencies: 186
-- Name: llx_accounting_bookkeeping_tmp_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_bookkeeping_tmp_rowid_seq OWNED BY public.llx_accounting_bookkeeping_tmp.rowid;


--
-- TOC entry 187 (class 1259 OID 834511)
-- Name: llx_accounting_fiscalyear; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_fiscalyear (
    rowid integer NOT NULL,
    label character varying(128) NOT NULL,
    date_start date,
    date_end date,
    statut smallint DEFAULT 0 NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_author integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_accounting_fiscalyear OWNER TO postgres;

--
-- TOC entry 188 (class 1259 OID 834517)
-- Name: llx_accounting_fiscalyear_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_fiscalyear_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_fiscalyear_rowid_seq OWNER TO postgres;

--
-- TOC entry 6451 (class 0 OID 0)
-- Dependencies: 188
-- Name: llx_accounting_fiscalyear_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_fiscalyear_rowid_seq OWNED BY public.llx_accounting_fiscalyear.rowid;


--
-- TOC entry 189 (class 1259 OID 834519)
-- Name: llx_accounting_journal; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_journal (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    code character varying(32) NOT NULL,
    label character varying(128) NOT NULL,
    nature smallint DEFAULT 1 NOT NULL,
    active smallint DEFAULT 0
);


ALTER TABLE public.llx_accounting_journal OWNER TO postgres;

--
-- TOC entry 190 (class 1259 OID 834525)
-- Name: llx_accounting_journal_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_journal_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_journal_rowid_seq OWNER TO postgres;

--
-- TOC entry 6452 (class 0 OID 0)
-- Dependencies: 190
-- Name: llx_accounting_journal_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_journal_rowid_seq OWNED BY public.llx_accounting_journal.rowid;


--
-- TOC entry 191 (class 1259 OID 834527)
-- Name: llx_accounting_system; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_accounting_system (
    rowid integer NOT NULL,
    pcg_version character varying(32) NOT NULL,
    label character varying(128) NOT NULL,
    active smallint DEFAULT 0
);


ALTER TABLE public.llx_accounting_system OWNER TO postgres;

--
-- TOC entry 192 (class 1259 OID 834531)
-- Name: llx_accounting_system_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_accounting_system_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_accounting_system_rowid_seq OWNER TO postgres;

--
-- TOC entry 6453 (class 0 OID 0)
-- Dependencies: 192
-- Name: llx_accounting_system_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_accounting_system_rowid_seq OWNED BY public.llx_accounting_system.rowid;


--
-- TOC entry 193 (class 1259 OID 834533)
-- Name: llx_actioncomm; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_actioncomm (
    id integer NOT NULL,
    ref_ext character varying(128),
    entity integer DEFAULT 1 NOT NULL,
    datep timestamp without time zone,
    datep2 timestamp without time zone,
    fk_action integer,
    code character varying(32),
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_author integer,
    fk_user_mod integer,
    fk_project integer,
    fk_soc integer,
    fk_contact integer,
    fk_parent integer DEFAULT 0 NOT NULL,
    fk_user_action integer,
    fk_user_done integer,
    transparency integer,
    priority smallint,
    fulldayevent smallint DEFAULT 0 NOT NULL,
    punctual smallint DEFAULT 1 NOT NULL,
    percent smallint DEFAULT 0 NOT NULL,
    location character varying(128),
    durationp real,
    label character varying(256) NOT NULL,
    note text,
    email_subject character varying(256),
    email_msgid character varying(256),
    email_from character varying(256),
    email_sender character varying(256),
    email_to character varying(256),
    email_tocc character varying(256),
    email_tobcc character varying(256),
    errors_to character varying(256),
    recurid character varying(128),
    recurrule character varying(128),
    recurdateend timestamp without time zone,
    fk_element integer,
    elementtype character varying(255) DEFAULT NULL::character varying,
    import_key character varying(14),
    extraparams character varying(255)
);


ALTER TABLE public.llx_actioncomm OWNER TO postgres;

--
-- TOC entry 194 (class 1259 OID 834546)
-- Name: llx_actioncomm_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_actioncomm_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_actioncomm_extrafields OWNER TO postgres;

--
-- TOC entry 195 (class 1259 OID 834550)
-- Name: llx_actioncomm_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_actioncomm_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_actioncomm_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6454 (class 0 OID 0)
-- Dependencies: 195
-- Name: llx_actioncomm_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_actioncomm_extrafields_rowid_seq OWNED BY public.llx_actioncomm_extrafields.rowid;


--
-- TOC entry 196 (class 1259 OID 834552)
-- Name: llx_actioncomm_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_actioncomm_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_actioncomm_id_seq OWNER TO postgres;

--
-- TOC entry 6455 (class 0 OID 0)
-- Dependencies: 196
-- Name: llx_actioncomm_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_actioncomm_id_seq OWNED BY public.llx_actioncomm.id;


--
-- TOC entry 197 (class 1259 OID 834554)
-- Name: llx_actioncomm_resources; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_actioncomm_resources (
    rowid integer NOT NULL,
    fk_actioncomm integer NOT NULL,
    element_type character varying(50) NOT NULL,
    fk_element integer NOT NULL,
    answer_status character varying(50),
    mandatory smallint,
    transparency smallint DEFAULT 1
);


ALTER TABLE public.llx_actioncomm_resources OWNER TO postgres;

--
-- TOC entry 198 (class 1259 OID 834558)
-- Name: llx_actioncomm_resources_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_actioncomm_resources_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_actioncomm_resources_rowid_seq OWNER TO postgres;

--
-- TOC entry 6456 (class 0 OID 0)
-- Dependencies: 198
-- Name: llx_actioncomm_resources_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_actioncomm_resources_rowid_seq OWNED BY public.llx_actioncomm_resources.rowid;

--
-- TOC entry 200 (class 1259 OID 834570)
-- Name: llx_adherent_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_adherent_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_adherent_extrafields OWNER TO postgres;

--
-- TOC entry 201 (class 1259 OID 834574)
-- Name: llx_adherent_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_adherent_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_adherent_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6457 (class 0 OID 0)
-- Dependencies: 201
-- Name: llx_adherent_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_adherent_extrafields_rowid_seq OWNED BY public.llx_adherent_extrafields.rowid;


--
-- TOC entry 202 (class 1259 OID 834576)
-- Name: llx_adherent_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_adherent_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_adherent_rowid_seq OWNER TO postgres;

--
-- TOC entry 6458 (class 0 OID 0)
-- Dependencies: 202
-- Name: llx_adherent_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_adherent_rowid_seq OWNED BY public.llx_adherent.rowid;


--
-- TOC entry 203 (class 1259 OID 834578)
-- Name: llx_adherent_type; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_adherent_type (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    statut smallint DEFAULT 0 NOT NULL,
    libelle character varying(50) NOT NULL,
    subscription character varying(3) DEFAULT 'yes'::character varying NOT NULL,
    vote character varying(3) DEFAULT 'yes'::character varying NOT NULL,
    note text,
    mail_valid text
);


ALTER TABLE public.llx_adherent_type OWNER TO postgres;

--
-- TOC entry 204 (class 1259 OID 834589)
-- Name: llx_adherent_type_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_adherent_type_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_adherent_type_extrafields OWNER TO postgres;

--
-- TOC entry 205 (class 1259 OID 834593)
-- Name: llx_adherent_type_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_adherent_type_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_adherent_type_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6459 (class 0 OID 0)
-- Dependencies: 205
-- Name: llx_adherent_type_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_adherent_type_extrafields_rowid_seq OWNED BY public.llx_adherent_type_extrafields.rowid;


--
-- TOC entry 206 (class 1259 OID 834595)
-- Name: llx_adherent_type_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_adherent_type_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_adherent_type_rowid_seq OWNER TO postgres;

--
-- TOC entry 6460 (class 0 OID 0)
-- Dependencies: 206
-- Name: llx_adherent_type_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_adherent_type_rowid_seq OWNED BY public.llx_adherent_type.rowid;


--
-- TOC entry 207 (class 1259 OID 834597)
-- Name: llx_advtargetemailing; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_advtargetemailing (
    rowid integer NOT NULL,
    name character varying(200) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_mailing integer NOT NULL,
    filtervalue text,
    fk_user_author integer NOT NULL,
    datec timestamp without time zone,
    fk_user_mod integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_advtargetemailing OWNER TO postgres;

--
-- TOC entry 208 (class 1259 OID 834605)
-- Name: llx_advtargetemailing_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_advtargetemailing_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_advtargetemailing_rowid_seq OWNER TO postgres;

--
-- TOC entry 6461 (class 0 OID 0)
-- Dependencies: 208
-- Name: llx_advtargetemailing_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_advtargetemailing_rowid_seq OWNED BY public.llx_advtargetemailing.rowid;


--
-- TOC entry 209 (class 1259 OID 834607)
-- Name: llx_bank; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bank (
    rowid integer NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datev date,
    dateo date,
    amount numeric(24,8) DEFAULT 0 NOT NULL,
    label character varying(255),
    fk_account integer,
    fk_user_author integer,
    fk_user_rappro integer,
    fk_type character varying(6),
    num_releve character varying(50),
    num_chq character varying(50),
    numero_compte character varying(32),
    rappro smallint DEFAULT 0,
    note text,
    fk_bordereau integer DEFAULT 0,
    banque character varying(255),
    emetteur character varying(255),
    author character varying(40)
);


ALTER TABLE public.llx_bank OWNER TO postgres;

--
-- TOC entry 211 (class 1259 OID 834630)
-- Name: llx_bank_account_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bank_account_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_bank_account_extrafields OWNER TO postgres;

--
-- TOC entry 212 (class 1259 OID 834634)
-- Name: llx_bank_account_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bank_account_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bank_account_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6462 (class 0 OID 0)
-- Dependencies: 212
-- Name: llx_bank_account_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bank_account_extrafields_rowid_seq OWNED BY public.llx_bank_account_extrafields.rowid;


--
-- TOC entry 213 (class 1259 OID 834636)
-- Name: llx_bank_account_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bank_account_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bank_account_rowid_seq OWNER TO postgres;

--
-- TOC entry 6463 (class 0 OID 0)
-- Dependencies: 213
-- Name: llx_bank_account_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bank_account_rowid_seq OWNED BY public.llx_bank_account.rowid;


--
-- TOC entry 214 (class 1259 OID 834638)
-- Name: llx_bank_categ; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bank_categ (
    rowid integer NOT NULL,
    label character varying(255),
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_bank_categ OWNER TO postgres;

--
-- TOC entry 215 (class 1259 OID 834642)
-- Name: llx_bank_categ_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bank_categ_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bank_categ_rowid_seq OWNER TO postgres;

--
-- TOC entry 6464 (class 0 OID 0)
-- Dependencies: 215
-- Name: llx_bank_categ_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bank_categ_rowid_seq OWNED BY public.llx_bank_categ.rowid;


--
-- TOC entry 216 (class 1259 OID 834644)
-- Name: llx_bank_class; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bank_class (
    lineid integer NOT NULL,
    fk_categ integer NOT NULL
);


ALTER TABLE public.llx_bank_class OWNER TO postgres;

--
-- TOC entry 217 (class 1259 OID 834647)
-- Name: llx_bank_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bank_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bank_rowid_seq OWNER TO postgres;

--
-- TOC entry 6465 (class 0 OID 0)
-- Dependencies: 217
-- Name: llx_bank_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bank_rowid_seq OWNED BY public.llx_bank.rowid;


--
-- TOC entry 218 (class 1259 OID 834649)
-- Name: llx_bank_url; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bank_url (
    rowid integer NOT NULL,
    fk_bank integer,
    url_id integer,
    url character varying(255),
    label character varying(255),
    type character varying(24) NOT NULL
);


ALTER TABLE public.llx_bank_url OWNER TO postgres;

--
-- TOC entry 219 (class 1259 OID 834655)
-- Name: llx_bank_url_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bank_url_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bank_url_rowid_seq OWNER TO postgres;

--
-- TOC entry 6466 (class 0 OID 0)
-- Dependencies: 219
-- Name: llx_bank_url_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bank_url_rowid_seq OWNED BY public.llx_bank_url.rowid;


--
-- TOC entry 220 (class 1259 OID 834657)
-- Name: llx_blockedlog; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_blockedlog (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    action character varying(50),
    amounts real NOT NULL,
    signature character varying(100) NOT NULL,
    signature_line character varying(100) NOT NULL,
    element character varying(50),
    fk_object integer,
    ref_object character varying(100),
    date_object timestamp without time zone,
    object_data text,
    fk_user integer,
    entity integer DEFAULT 1 NOT NULL,
    certified integer
);


ALTER TABLE public.llx_blockedlog OWNER TO postgres;

--
-- TOC entry 221 (class 1259 OID 834665)
-- Name: llx_blockedlog_authority; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_blockedlog_authority (
    rowid integer NOT NULL,
    blockchain text NOT NULL,
    signature character varying(100) NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_blockedlog_authority OWNER TO postgres;

--
-- TOC entry 222 (class 1259 OID 834672)
-- Name: llx_blockedlog_authority_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_blockedlog_authority_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_blockedlog_authority_rowid_seq OWNER TO postgres;

--
-- TOC entry 6467 (class 0 OID 0)
-- Dependencies: 222
-- Name: llx_blockedlog_authority_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_blockedlog_authority_rowid_seq OWNED BY public.llx_blockedlog_authority.rowid;


--
-- TOC entry 223 (class 1259 OID 834674)
-- Name: llx_blockedlog_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_blockedlog_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_blockedlog_rowid_seq OWNER TO postgres;

--
-- TOC entry 6468 (class 0 OID 0)
-- Dependencies: 223
-- Name: llx_blockedlog_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_blockedlog_rowid_seq OWNED BY public.llx_blockedlog.rowid;


--
-- TOC entry 224 (class 1259 OID 834676)
-- Name: llx_bookmark; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bookmark (
    rowid integer NOT NULL,
    fk_soc integer,
    fk_user integer NOT NULL,
    dateb timestamp without time zone,
    url character varying(255) NOT NULL,
    target character varying(16),
    title character varying(64),
    favicon character varying(24),
    "position" integer DEFAULT 0,
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_bookmark OWNER TO postgres;

--
-- TOC entry 225 (class 1259 OID 834681)
-- Name: llx_bookmark_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bookmark_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bookmark_rowid_seq OWNER TO postgres;

--
-- TOC entry 6469 (class 0 OID 0)
-- Dependencies: 225
-- Name: llx_bookmark_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bookmark_rowid_seq OWNED BY public.llx_bookmark.rowid;


--
-- TOC entry 226 (class 1259 OID 834683)
-- Name: llx_bordereau_cheque; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_bordereau_cheque (
    rowid integer NOT NULL,
    ref character varying(30) NOT NULL,
    ref_ext character varying(255),
    datec timestamp without time zone,
    date_bordereau date,
    amount numeric(24,8) NOT NULL,
    nbcheque smallint NOT NULL,
    fk_bank_account integer,
    fk_user_author integer,
    statut smallint DEFAULT 0 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    note text,
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_bordereau_cheque OWNER TO postgres;

--
-- TOC entry 227 (class 1259 OID 834692)
-- Name: llx_bordereau_cheque_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_bordereau_cheque_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_bordereau_cheque_rowid_seq OWNER TO postgres;

--
-- TOC entry 6470 (class 0 OID 0)
-- Dependencies: 227
-- Name: llx_bordereau_cheque_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_bordereau_cheque_rowid_seq OWNED BY public.llx_bordereau_cheque.rowid;


--
-- TOC entry 228 (class 1259 OID 834694)
-- Name: llx_boxes; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_boxes (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    box_id integer NOT NULL,
    "position" smallint NOT NULL,
    box_order character varying(3) NOT NULL,
    fk_user integer DEFAULT 0 NOT NULL,
    maxline integer,
    params character varying(255)
);


ALTER TABLE public.llx_boxes OWNER TO postgres;

--
-- TOC entry 229 (class 1259 OID 834699)
-- Name: llx_boxes_def; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_boxes_def (
    rowid integer NOT NULL,
    file character varying(200) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    note character varying(130)
);


ALTER TABLE public.llx_boxes_def OWNER TO postgres;

--
-- TOC entry 230 (class 1259 OID 834704)
-- Name: llx_boxes_def_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_boxes_def_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_boxes_def_rowid_seq OWNER TO postgres;

--
-- TOC entry 6471 (class 0 OID 0)
-- Dependencies: 230
-- Name: llx_boxes_def_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_boxes_def_rowid_seq OWNED BY public.llx_boxes_def.rowid;


--
-- TOC entry 231 (class 1259 OID 834706)
-- Name: llx_boxes_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_boxes_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_boxes_rowid_seq OWNER TO postgres;

--
-- TOC entry 6472 (class 0 OID 0)
-- Dependencies: 231
-- Name: llx_boxes_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_boxes_rowid_seq OWNED BY public.llx_boxes.rowid;


--
-- TOC entry 232 (class 1259 OID 834708)
-- Name: llx_budget; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_budget (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    label character varying(255) NOT NULL,
    status integer,
    note text,
    date_start date,
    date_end date,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer,
    import_key integer
);


ALTER TABLE public.llx_budget OWNER TO postgres;

--
-- TOC entry 233 (class 1259 OID 834716)
-- Name: llx_budget_lines; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_budget_lines (
    rowid integer NOT NULL,
    fk_budget integer NOT NULL,
    fk_project_ids character varying(255) NOT NULL,
    amount numeric(24,8) NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer,
    import_key integer
);


ALTER TABLE public.llx_budget_lines OWNER TO postgres;

--
-- TOC entry 234 (class 1259 OID 834720)
-- Name: llx_budget_lines_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_budget_lines_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_budget_lines_rowid_seq OWNER TO postgres;

--
-- TOC entry 6473 (class 0 OID 0)
-- Dependencies: 234
-- Name: llx_budget_lines_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_budget_lines_rowid_seq OWNED BY public.llx_budget_lines.rowid;


--
-- TOC entry 235 (class 1259 OID 834722)
-- Name: llx_budget_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_budget_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_budget_rowid_seq OWNER TO postgres;

--
-- TOC entry 6474 (class 0 OID 0)
-- Dependencies: 235
-- Name: llx_budget_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_budget_rowid_seq OWNED BY public.llx_budget.rowid;


--
-- TOC entry 236 (class 1259 OID 834724)
-- Name: llx_c_accounting_category; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_accounting_category (
    rowid integer NOT NULL,
    code character varying(16) NOT NULL,
    label character varying(255) NOT NULL,
    range_account character varying(255) NOT NULL,
    sens smallint DEFAULT '0'::smallint NOT NULL,
    category_type smallint DEFAULT '0'::smallint NOT NULL,
    formula character varying(255) NOT NULL,
    "position" integer DEFAULT 0,
    fk_country integer,
    active integer DEFAULT 1
);


ALTER TABLE public.llx_c_accounting_category OWNER TO postgres;

--
-- TOC entry 237 (class 1259 OID 834734)
-- Name: llx_c_accounting_category_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_accounting_category_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_accounting_category_rowid_seq OWNER TO postgres;

--
-- TOC entry 6475 (class 0 OID 0)
-- Dependencies: 237
-- Name: llx_c_accounting_category_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_accounting_category_rowid_seq OWNED BY public.llx_c_accounting_category.rowid;


--
-- TOC entry 238 (class 1259 OID 834736)
-- Name: llx_c_action_trigger; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_action_trigger (
    rowid integer NOT NULL,
    elementtype character varying(16) NOT NULL,
    code character varying(32) NOT NULL,
    label character varying(128) NOT NULL,
    description character varying(255),
    rang integer DEFAULT 0
);


ALTER TABLE public.llx_c_action_trigger OWNER TO postgres;

--
-- TOC entry 239 (class 1259 OID 834740)
-- Name: llx_c_action_trigger_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_action_trigger_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_action_trigger_rowid_seq OWNER TO postgres;

--
-- TOC entry 6476 (class 0 OID 0)
-- Dependencies: 239
-- Name: llx_c_action_trigger_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_action_trigger_rowid_seq OWNED BY public.llx_c_action_trigger.rowid;


--
-- TOC entry 240 (class 1259 OID 834742)
-- Name: llx_c_actioncomm; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_actioncomm (
    id integer NOT NULL,
    code character varying(12) NOT NULL,
    type character varying(50) DEFAULT 'system'::character varying NOT NULL,
    libelle character varying(48) NOT NULL,
    module character varying(16) DEFAULT NULL::character varying,
    active smallint DEFAULT 1 NOT NULL,
    todo smallint,
    color character varying(9),
    picto character varying(48),
    "position" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_actioncomm OWNER TO postgres;

--
-- TOC entry 241 (class 1259 OID 834749)
-- Name: llx_c_availability; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_availability (
    rowid integer NOT NULL,
    code character varying(30) NOT NULL,
    label character varying(60) NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_availability OWNER TO postgres;

--
-- TOC entry 242 (class 1259 OID 834753)
-- Name: llx_c_availability_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_availability_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_availability_rowid_seq OWNER TO postgres;

--
-- TOC entry 6477 (class 0 OID 0)
-- Dependencies: 242
-- Name: llx_c_availability_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_availability_rowid_seq OWNED BY public.llx_c_availability.rowid;


--
-- TOC entry 243 (class 1259 OID 834755)
-- Name: llx_c_barcode_type; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_barcode_type (
    rowid integer NOT NULL,
    code character varying(16) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    libelle character varying(50) NOT NULL,
    coder character varying(16) NOT NULL,
    example character varying(16) NOT NULL
);


ALTER TABLE public.llx_c_barcode_type OWNER TO postgres;

--
-- TOC entry 244 (class 1259 OID 834759)
-- Name: llx_c_barcode_type_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_barcode_type_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_barcode_type_rowid_seq OWNER TO postgres;

--
-- TOC entry 6478 (class 0 OID 0)
-- Dependencies: 244
-- Name: llx_c_barcode_type_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_barcode_type_rowid_seq OWNED BY public.llx_c_barcode_type.rowid;


--
-- TOC entry 245 (class 1259 OID 834761)
-- Name: llx_c_chargesociales; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_chargesociales (
    id integer NOT NULL,
    libelle character varying(80),
    deductible smallint DEFAULT 0 NOT NULL,
    active smallint DEFAULT 1 NOT NULL,
    code character varying(12) NOT NULL,
    accountancy_code character varying(32) DEFAULT NULL::character varying,
    fk_pays integer DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_chargesociales OWNER TO postgres;

--
-- TOC entry 246 (class 1259 OID 834768)
-- Name: llx_c_chargesociales_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_chargesociales_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_chargesociales_id_seq OWNER TO postgres;

--
-- TOC entry 6479 (class 0 OID 0)
-- Dependencies: 246
-- Name: llx_c_chargesociales_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_chargesociales_id_seq OWNED BY public.llx_c_chargesociales.id;


--
-- TOC entry 247 (class 1259 OID 834770)
-- Name: llx_c_civility; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_civility (
    rowid integer NOT NULL,
    code character varying(6) NOT NULL,
    label character varying(50),
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_civility OWNER TO postgres;

--
-- TOC entry 248 (class 1259 OID 834774)
-- Name: llx_c_country; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_country (
    rowid integer NOT NULL,
    code character varying(2) NOT NULL,
    code_iso character varying(3),
    label character varying(50) NOT NULL,
    active smallint DEFAULT 1 NOT NULL,
    favorite smallint DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_country OWNER TO postgres;

--
-- TOC entry 249 (class 1259 OID 834779)
-- Name: llx_c_currencies; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_currencies (
    code_iso character varying(3) NOT NULL,
    label character varying(64) NOT NULL,
    unicode character varying(32) DEFAULT NULL::character varying,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_currencies OWNER TO postgres;

--
-- TOC entry 250 (class 1259 OID 834784)
-- Name: llx_c_departements; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_departements (
    rowid integer NOT NULL,
    code_departement character varying(6) NOT NULL,
    fk_region integer,
    cheflieu character varying(50),
    tncc integer,
    ncc character varying(50),
    nom character varying(50),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_departements OWNER TO postgres;

--
-- TOC entry 251 (class 1259 OID 834788)
-- Name: llx_c_departements_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_departements_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_departements_rowid_seq OWNER TO postgres;

--
-- TOC entry 6480 (class 0 OID 0)
-- Dependencies: 251
-- Name: llx_c_departements_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_departements_rowid_seq OWNED BY public.llx_c_departements.rowid;


--
-- TOC entry 252 (class 1259 OID 834790)
-- Name: llx_c_ecotaxe; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_ecotaxe (
    rowid integer NOT NULL,
    code character varying(64) NOT NULL,
    libelle character varying(255),
    price numeric(24,8),
    organization character varying(255),
    fk_pays integer NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_ecotaxe OWNER TO postgres;

--
-- TOC entry 253 (class 1259 OID 834797)
-- Name: llx_c_ecotaxe_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_ecotaxe_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_ecotaxe_rowid_seq OWNER TO postgres;

--
-- TOC entry 6481 (class 0 OID 0)
-- Dependencies: 253
-- Name: llx_c_ecotaxe_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_ecotaxe_rowid_seq OWNED BY public.llx_c_ecotaxe.rowid;


--
-- TOC entry 254 (class 1259 OID 834799)
-- Name: llx_c_effectif; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_effectif (
    id integer NOT NULL,
    code character varying(12) NOT NULL,
    libelle character varying(30),
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_effectif OWNER TO postgres;

--
-- TOC entry 255 (class 1259 OID 834803)
-- Name: llx_c_email_templates; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_email_templates (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    module character varying(32),
    type_template character varying(32),
    lang character varying(6),
    private smallint DEFAULT 0 NOT NULL,
    fk_user integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    label character varying(255),
    "position" smallint,
    active smallint DEFAULT 1 NOT NULL,
    topic text,
    content text,
    content_lines text
);


ALTER TABLE public.llx_c_email_templates OWNER TO postgres;

--
-- TOC entry 256 (class 1259 OID 834813)
-- Name: llx_c_email_templates_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_email_templates_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_email_templates_rowid_seq OWNER TO postgres;

--
-- TOC entry 6482 (class 0 OID 0)
-- Dependencies: 256
-- Name: llx_c_email_templates_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_email_templates_rowid_seq OWNED BY public.llx_c_email_templates.rowid;


--
-- TOC entry 257 (class 1259 OID 834815)
-- Name: llx_c_field_list; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_field_list (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    element character varying(64) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    name character varying(32) NOT NULL,
    alias character varying(32) NOT NULL,
    title character varying(32) NOT NULL,
    align character varying(6) DEFAULT 'left'::character varying,
    sort smallint DEFAULT 1 NOT NULL,
    search smallint DEFAULT 0 NOT NULL,
    enabled character varying(255) DEFAULT 1,
    rang integer DEFAULT 0
);


ALTER TABLE public.llx_c_field_list OWNER TO postgres;

--
-- TOC entry 258 (class 1259 OID 834825)
-- Name: llx_c_field_list_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_field_list_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_field_list_rowid_seq OWNER TO postgres;

--
-- TOC entry 6483 (class 0 OID 0)
-- Dependencies: 258
-- Name: llx_c_field_list_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_field_list_rowid_seq OWNED BY public.llx_c_field_list.rowid;


--
-- TOC entry 259 (class 1259 OID 834827)
-- Name: llx_c_format_cards; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_format_cards (
    rowid integer NOT NULL,
    code character varying(50) NOT NULL,
    name character varying(50) NOT NULL,
    paper_size character varying(20) NOT NULL,
    orientation character varying(1) NOT NULL,
    metric character varying(5) NOT NULL,
    leftmargin numeric(24,8) NOT NULL,
    topmargin numeric(24,8) NOT NULL,
    nx integer NOT NULL,
    ny integer NOT NULL,
    spacex numeric(24,8) NOT NULL,
    spacey numeric(24,8) NOT NULL,
    width numeric(24,8) NOT NULL,
    height numeric(24,8) NOT NULL,
    font_size integer NOT NULL,
    custom_x numeric(24,8) NOT NULL,
    custom_y numeric(24,8) NOT NULL,
    active integer NOT NULL
);


ALTER TABLE public.llx_c_format_cards OWNER TO postgres;

--
-- TOC entry 260 (class 1259 OID 834830)
-- Name: llx_c_format_cards_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_format_cards_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_format_cards_rowid_seq OWNER TO postgres;

--
-- TOC entry 6484 (class 0 OID 0)
-- Dependencies: 260
-- Name: llx_c_format_cards_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_format_cards_rowid_seq OWNED BY public.llx_c_format_cards.rowid;


--
-- TOC entry 261 (class 1259 OID 834832)
-- Name: llx_c_forme_juridique; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_forme_juridique (
    rowid integer NOT NULL,
    code integer NOT NULL,
    fk_pays integer NOT NULL,
    libelle character varying(255),
    isvatexempted smallint DEFAULT 0 NOT NULL,
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32),
    "position" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_forme_juridique OWNER TO postgres;

--
-- TOC entry 262 (class 1259 OID 834838)
-- Name: llx_c_forme_juridique_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_forme_juridique_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_forme_juridique_rowid_seq OWNER TO postgres;

--
-- TOC entry 6485 (class 0 OID 0)
-- Dependencies: 262
-- Name: llx_c_forme_juridique_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_forme_juridique_rowid_seq OWNED BY public.llx_c_forme_juridique.rowid;


--
-- TOC entry 263 (class 1259 OID 834840)
-- Name: llx_c_holiday_types; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_holiday_types (
    rowid integer NOT NULL,
    code character varying(16) NOT NULL,
    label character varying(255) NOT NULL,
    affect integer NOT NULL,
    delay integer NOT NULL,
    newbymonth numeric(8,5) DEFAULT 0 NOT NULL,
    fk_country integer,
    active integer DEFAULT 1
);


ALTER TABLE public.llx_c_holiday_types OWNER TO postgres;

--
-- TOC entry 264 (class 1259 OID 834845)
-- Name: llx_c_holiday_types_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_holiday_types_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_holiday_types_rowid_seq OWNER TO postgres;

--
-- TOC entry 6486 (class 0 OID 0)
-- Dependencies: 264
-- Name: llx_c_holiday_types_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_holiday_types_rowid_seq OWNED BY public.llx_c_holiday_types.rowid;


--
-- TOC entry 265 (class 1259 OID 834847)
-- Name: llx_c_hrm_department; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_hrm_department (
    rowid integer NOT NULL,
    pos smallint DEFAULT 0 NOT NULL,
    code character varying(16) NOT NULL,
    label character varying(50),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_hrm_department OWNER TO postgres;

--
-- TOC entry 266 (class 1259 OID 834852)
-- Name: llx_c_hrm_function; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_hrm_function (
    rowid integer NOT NULL,
    pos smallint DEFAULT 0 NOT NULL,
    code character varying(16) NOT NULL,
    label character varying(50),
    c_level smallint DEFAULT 0 NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_hrm_function OWNER TO postgres;

--
-- TOC entry 267 (class 1259 OID 834858)
-- Name: llx_c_incoterms; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_incoterms (
    rowid integer NOT NULL,
    code character varying(3) NOT NULL,
    libelle character varying(255) NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_incoterms OWNER TO postgres;

--
-- TOC entry 268 (class 1259 OID 834862)
-- Name: llx_c_incoterms_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_incoterms_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_incoterms_rowid_seq OWNER TO postgres;

--
-- TOC entry 6487 (class 0 OID 0)
-- Dependencies: 268
-- Name: llx_c_incoterms_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_incoterms_rowid_seq OWNED BY public.llx_c_incoterms.rowid;


--
-- TOC entry 269 (class 1259 OID 834864)
-- Name: llx_c_input_method; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_input_method (
    rowid integer NOT NULL,
    code character varying(30),
    libelle character varying(60),
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_input_method OWNER TO postgres;

--
-- TOC entry 270 (class 1259 OID 834868)
-- Name: llx_c_input_method_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_input_method_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_input_method_rowid_seq OWNER TO postgres;

--
-- TOC entry 6488 (class 0 OID 0)
-- Dependencies: 270
-- Name: llx_c_input_method_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_input_method_rowid_seq OWNED BY public.llx_c_input_method.rowid;


--
-- TOC entry 271 (class 1259 OID 834870)
-- Name: llx_c_input_reason; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_input_reason (
    rowid integer NOT NULL,
    code character varying(30),
    label character varying(60),
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_input_reason OWNER TO postgres;

--
-- TOC entry 272 (class 1259 OID 834874)
-- Name: llx_c_input_reason_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_input_reason_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_input_reason_rowid_seq OWNER TO postgres;

--
-- TOC entry 6489 (class 0 OID 0)
-- Dependencies: 272
-- Name: llx_c_input_reason_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_input_reason_rowid_seq OWNED BY public.llx_c_input_reason.rowid;


--
-- TOC entry 273 (class 1259 OID 834876)
-- Name: llx_c_lead_status; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_lead_status (
    rowid integer NOT NULL,
    code character varying(10),
    label character varying(50),
    "position" integer,
    percent numeric(5,2),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_lead_status OWNER TO postgres;

--
-- TOC entry 274 (class 1259 OID 834880)
-- Name: llx_c_lead_status_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_lead_status_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_lead_status_rowid_seq OWNER TO postgres;

--
-- TOC entry 6490 (class 0 OID 0)
-- Dependencies: 274
-- Name: llx_c_lead_status_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_lead_status_rowid_seq OWNED BY public.llx_c_lead_status.rowid;


--
-- TOC entry 275 (class 1259 OID 834882)
-- Name: llx_c_paiement; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_paiement (
    id integer NOT NULL,
    code character varying(6) NOT NULL,
    libelle character varying(62),
    type smallint,
    active smallint DEFAULT 1 NOT NULL,
    accountancy_code character varying(32),
    module character varying(32)
);


ALTER TABLE public.llx_c_paiement OWNER TO postgres;

--
-- TOC entry 276 (class 1259 OID 834886)
-- Name: llx_c_paper_format; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_paper_format (
    rowid integer NOT NULL,
    code character varying(16) NOT NULL,
    label character varying(50) NOT NULL,
    width numeric(6,2) DEFAULT 0,
    height numeric(6,2) DEFAULT 0,
    unit character varying(5) NOT NULL,
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_paper_format OWNER TO postgres;

--
-- TOC entry 277 (class 1259 OID 834892)
-- Name: llx_c_paper_format_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_paper_format_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_paper_format_rowid_seq OWNER TO postgres;

--
-- TOC entry 6491 (class 0 OID 0)
-- Dependencies: 277
-- Name: llx_c_paper_format_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_paper_format_rowid_seq OWNED BY public.llx_c_paper_format.rowid;


--
-- TOC entry 278 (class 1259 OID 834894)
-- Name: llx_c_payment_term; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_payment_term (
    rowid integer NOT NULL,
    code character varying(16),
    sortorder smallint,
    active smallint DEFAULT 1,
    libelle character varying(255),
    libelle_facture text,
    type_cdr smallint,
    nbjour smallint,
    decalage smallint,
    module character varying(32)
);


ALTER TABLE public.llx_c_payment_term OWNER TO postgres;

--
-- TOC entry 279 (class 1259 OID 834901)
-- Name: llx_c_price_expression; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_price_expression (
    rowid integer NOT NULL,
    title character varying(20) NOT NULL,
    expression character varying(80) NOT NULL
);


ALTER TABLE public.llx_c_price_expression OWNER TO postgres;

--
-- TOC entry 280 (class 1259 OID 834904)
-- Name: llx_c_price_expression_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_price_expression_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_price_expression_rowid_seq OWNER TO postgres;

--
-- TOC entry 6492 (class 0 OID 0)
-- Dependencies: 280
-- Name: llx_c_price_expression_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_price_expression_rowid_seq OWNED BY public.llx_c_price_expression.rowid;


--
-- TOC entry 281 (class 1259 OID 834906)
-- Name: llx_c_price_global_variable; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_price_global_variable (
    rowid integer NOT NULL,
    code character varying(20) NOT NULL,
    description text,
    value numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_c_price_global_variable OWNER TO postgres;

--
-- TOC entry 282 (class 1259 OID 834913)
-- Name: llx_c_price_global_variable_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_price_global_variable_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_price_global_variable_rowid_seq OWNER TO postgres;

--
-- TOC entry 6493 (class 0 OID 0)
-- Dependencies: 282
-- Name: llx_c_price_global_variable_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_price_global_variable_rowid_seq OWNED BY public.llx_c_price_global_variable.rowid;


--
-- TOC entry 283 (class 1259 OID 834915)
-- Name: llx_c_price_global_variable_updater; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_price_global_variable_updater (
    rowid integer NOT NULL,
    type integer NOT NULL,
    description text,
    parameters text,
    fk_variable integer NOT NULL,
    update_interval integer DEFAULT 0,
    next_update integer DEFAULT 0,
    last_status text
);


ALTER TABLE public.llx_c_price_global_variable_updater OWNER TO postgres;

--
-- TOC entry 284 (class 1259 OID 834923)
-- Name: llx_c_price_global_variable_updater_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_price_global_variable_updater_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_price_global_variable_updater_rowid_seq OWNER TO postgres;

--
-- TOC entry 6494 (class 0 OID 0)
-- Dependencies: 284
-- Name: llx_c_price_global_variable_updater_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_price_global_variable_updater_rowid_seq OWNED BY public.llx_c_price_global_variable_updater.rowid;


--
-- TOC entry 285 (class 1259 OID 834925)
-- Name: llx_c_propalst; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_propalst (
    id smallint NOT NULL,
    code character varying(12) NOT NULL,
    label character varying(30),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_propalst OWNER TO postgres;

--
-- TOC entry 286 (class 1259 OID 834929)
-- Name: llx_c_prospectlevel; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_prospectlevel (
    code character varying(12) NOT NULL,
    label character varying(30),
    sortorder smallint,
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32)
);


ALTER TABLE public.llx_c_prospectlevel OWNER TO postgres;

--
-- TOC entry 287 (class 1259 OID 834933)
-- Name: llx_c_regions; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_regions (
    rowid integer NOT NULL,
    code_region integer NOT NULL,
    fk_pays integer NOT NULL,
    cheflieu character varying(50),
    tncc integer,
    nom character varying(100),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_regions OWNER TO postgres;

--
-- TOC entry 288 (class 1259 OID 834937)
-- Name: llx_c_regions_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_regions_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_regions_rowid_seq OWNER TO postgres;

--
-- TOC entry 6495 (class 0 OID 0)
-- Dependencies: 288
-- Name: llx_c_regions_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_regions_rowid_seq OWNED BY public.llx_c_regions.rowid;


--
-- TOC entry 289 (class 1259 OID 834939)
-- Name: llx_c_revenuestamp; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_revenuestamp (
    rowid integer NOT NULL,
    fk_pays integer NOT NULL,
    taux numeric NOT NULL,
    note character varying(128),
    active smallint DEFAULT 1 NOT NULL,
    accountancy_code_sell character varying(32) DEFAULT NULL::character varying,
    accountancy_code_buy character varying(32) DEFAULT NULL::character varying
);


ALTER TABLE public.llx_c_revenuestamp OWNER TO postgres;

--
-- TOC entry 290 (class 1259 OID 834948)
-- Name: llx_c_revenuestamp_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_revenuestamp_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_revenuestamp_rowid_seq OWNER TO postgres;

--
-- TOC entry 6496 (class 0 OID 0)
-- Dependencies: 290
-- Name: llx_c_revenuestamp_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_revenuestamp_rowid_seq OWNED BY public.llx_c_revenuestamp.rowid;


--
-- TOC entry 291 (class 1259 OID 834950)
-- Name: llx_c_shipment_mode; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_shipment_mode (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    code character varying(30) NOT NULL,
    libelle character varying(50) NOT NULL,
    description text,
    tracking character varying(255) NOT NULL,
    active smallint DEFAULT 0,
    module character varying(32)
);


ALTER TABLE public.llx_c_shipment_mode OWNER TO postgres;

--
-- TOC entry 292 (class 1259 OID 834958)
-- Name: llx_c_shipment_mode_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_shipment_mode_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_shipment_mode_rowid_seq OWNER TO postgres;

--
-- TOC entry 6497 (class 0 OID 0)
-- Dependencies: 292
-- Name: llx_c_shipment_mode_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_shipment_mode_rowid_seq OWNED BY public.llx_c_shipment_mode.rowid;


--
-- TOC entry 293 (class 1259 OID 834960)
-- Name: llx_c_stcomm; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_stcomm (
    id integer NOT NULL,
    code character varying(12) NOT NULL,
    libelle character varying(30),
    picto character varying(128),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_stcomm OWNER TO postgres;

--
-- TOC entry 294 (class 1259 OID 834964)
-- Name: llx_c_tva; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_tva (
    rowid integer NOT NULL,
    fk_pays integer NOT NULL,
    code character varying(10) DEFAULT ''::character varying,
    taux numeric NOT NULL,
    localtax1 character varying(20) DEFAULT '0'::character varying NOT NULL,
    localtax1_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    localtax2 character varying(20) DEFAULT '0'::character varying NOT NULL,
    localtax2_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    recuperableonly integer DEFAULT 0 NOT NULL,
    note character varying(128),
    active smallint DEFAULT 1 NOT NULL,
    accountancy_code_sell character varying(32) DEFAULT NULL::character varying,
    accountancy_code_buy character varying(32) DEFAULT NULL::character varying
);


ALTER TABLE public.llx_c_tva OWNER TO postgres;

--
-- TOC entry 295 (class 1259 OID 834979)
-- Name: llx_c_tva_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_tva_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_tva_rowid_seq OWNER TO postgres;

--
-- TOC entry 6498 (class 0 OID 0)
-- Dependencies: 295
-- Name: llx_c_tva_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_tva_rowid_seq OWNED BY public.llx_c_tva.rowid;


--
-- TOC entry 296 (class 1259 OID 834981)
-- Name: llx_c_type_contact; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_type_contact (
    rowid integer NOT NULL,
    element character varying(30) NOT NULL,
    source character varying(8) DEFAULT 'external'::character varying NOT NULL,
    code character varying(32) NOT NULL,
    libelle character varying(64) NOT NULL,
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32),
    "position" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_type_contact OWNER TO postgres;

--
-- TOC entry 297 (class 1259 OID 834987)
-- Name: llx_c_type_fees; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_type_fees (
    id integer NOT NULL,
    code character varying(12) NOT NULL,
    label character varying(30),
    accountancy_code character varying(32),
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32),
    "position" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_type_fees OWNER TO postgres;

--
-- TOC entry 298 (class 1259 OID 834992)
-- Name: llx_c_type_fees_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_type_fees_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_type_fees_id_seq OWNER TO postgres;

--
-- TOC entry 6499 (class 0 OID 0)
-- Dependencies: 298
-- Name: llx_c_type_fees_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_type_fees_id_seq OWNED BY public.llx_c_type_fees.id;


--
-- TOC entry 299 (class 1259 OID 834994)
-- Name: llx_c_type_resource; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_type_resource (
    rowid integer NOT NULL,
    code character varying(32) NOT NULL,
    label character varying(64) NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_type_resource OWNER TO postgres;

--
-- TOC entry 300 (class 1259 OID 834998)
-- Name: llx_c_type_resource_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_type_resource_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_type_resource_rowid_seq OWNER TO postgres;

--
-- TOC entry 6500 (class 0 OID 0)
-- Dependencies: 300
-- Name: llx_c_type_resource_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_type_resource_rowid_seq OWNED BY public.llx_c_type_resource.rowid;


--
-- TOC entry 301 (class 1259 OID 835000)
-- Name: llx_c_typent; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_typent (
    id integer NOT NULL,
    code character varying(12) NOT NULL,
    libelle character varying(64),
    fk_country integer,
    active smallint DEFAULT 1 NOT NULL,
    module character varying(32),
    "position" integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_c_typent OWNER TO postgres;

--
-- TOC entry 302 (class 1259 OID 835005)
-- Name: llx_c_units; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_units (
    rowid integer NOT NULL,
    code character varying(3),
    label character varying(50),
    short_label character varying(5),
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_units OWNER TO postgres;

--
-- TOC entry 303 (class 1259 OID 835009)
-- Name: llx_c_units_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_units_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_units_rowid_seq OWNER TO postgres;

--
-- TOC entry 6501 (class 0 OID 0)
-- Dependencies: 303
-- Name: llx_c_units_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_units_rowid_seq OWNED BY public.llx_c_units.rowid;


--
-- TOC entry 304 (class 1259 OID 835011)
-- Name: llx_c_ziptown; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_c_ziptown (
    rowid integer NOT NULL,
    code character varying(5) DEFAULT NULL::character varying,
    fk_county integer,
    fk_pays integer DEFAULT 0 NOT NULL,
    zip character varying(10) NOT NULL,
    town character varying(255) NOT NULL,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_c_ziptown OWNER TO postgres;

--
-- TOC entry 305 (class 1259 OID 835017)
-- Name: llx_c_ziptown_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_c_ziptown_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_c_ziptown_rowid_seq OWNER TO postgres;

--
-- TOC entry 6502 (class 0 OID 0)
-- Dependencies: 305
-- Name: llx_c_ziptown_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_c_ziptown_rowid_seq OWNED BY public.llx_c_ziptown.rowid;


--
-- TOC entry 306 (class 1259 OID 835019)
-- Name: llx_categorie; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_parent integer DEFAULT 0 NOT NULL,
    label character varying(255) NOT NULL,
    type smallint DEFAULT 1 NOT NULL,
    description text,
    color character varying(8),
    fk_soc integer,
    visible smallint DEFAULT 1 NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie OWNER TO postgres;

--
-- TOC entry 307 (class 1259 OID 835029)
-- Name: llx_categorie_account; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_account (
    fk_categorie integer NOT NULL,
    fk_account integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_account OWNER TO postgres;

--
-- TOC entry 308 (class 1259 OID 835032)
-- Name: llx_categorie_contact; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_contact (
    fk_categorie integer NOT NULL,
    fk_socpeople integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_contact OWNER TO postgres;

--
-- TOC entry 309 (class 1259 OID 835035)
-- Name: llx_categorie_fournisseur; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_fournisseur (
    fk_categorie integer NOT NULL,
    fk_soc integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_fournisseur OWNER TO postgres;

--
-- TOC entry 310 (class 1259 OID 835038)
-- Name: llx_categorie_lang; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_lang (
    rowid integer NOT NULL,
    fk_category integer DEFAULT 0 NOT NULL,
    lang character varying(5) DEFAULT 0 NOT NULL,
    label character varying(255) NOT NULL,
    description text
);


ALTER TABLE public.llx_categorie_lang OWNER TO postgres;

--
-- TOC entry 311 (class 1259 OID 835046)
-- Name: llx_categorie_lang_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_categorie_lang_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_categorie_lang_rowid_seq OWNER TO postgres;

--
-- TOC entry 6503 (class 0 OID 0)
-- Dependencies: 311
-- Name: llx_categorie_lang_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_categorie_lang_rowid_seq OWNED BY public.llx_categorie_lang.rowid;


--
-- TOC entry 312 (class 1259 OID 835048)
-- Name: llx_categorie_member; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_member (
    fk_categorie integer NOT NULL,
    fk_member integer NOT NULL
);


ALTER TABLE public.llx_categorie_member OWNER TO postgres;

--
-- TOC entry 313 (class 1259 OID 835051)
-- Name: llx_categorie_product; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_product (
    fk_categorie integer NOT NULL,
    fk_product integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_product OWNER TO postgres;

--
-- TOC entry 314 (class 1259 OID 835054)
-- Name: llx_categorie_project; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_project (
    fk_categorie integer NOT NULL,
    fk_project integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_project OWNER TO postgres;

--
-- TOC entry 315 (class 1259 OID 835057)
-- Name: llx_categorie_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_categorie_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_categorie_rowid_seq OWNER TO postgres;

--
-- TOC entry 6504 (class 0 OID 0)
-- Dependencies: 315
-- Name: llx_categorie_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_categorie_rowid_seq OWNED BY public.llx_categorie.rowid;


--
-- TOC entry 316 (class 1259 OID 835059)
-- Name: llx_categorie_societe; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_societe (
    fk_categorie integer NOT NULL,
    fk_soc integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_societe OWNER TO postgres;

--
-- TOC entry 317 (class 1259 OID 835062)
-- Name: llx_categorie_user; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categorie_user (
    fk_categorie integer NOT NULL,
    fk_user integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categorie_user OWNER TO postgres;

--
-- TOC entry 318 (class 1259 OID 835065)
-- Name: llx_categories_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_categories_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_categories_extrafields OWNER TO postgres;

--
-- TOC entry 319 (class 1259 OID 835069)
-- Name: llx_categories_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_categories_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_categories_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6505 (class 0 OID 0)
-- Dependencies: 319
-- Name: llx_categories_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_categories_extrafields_rowid_seq OWNED BY public.llx_categories_extrafields.rowid;


--
-- TOC entry 320 (class 1259 OID 835071)
-- Name: llx_chargesociales; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_chargesociales (
    rowid integer NOT NULL,
    ref character varying(16),
    date_ech timestamp without time zone,
    libelle character varying(80) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    date_creation timestamp without time zone,
    date_valid timestamp without time zone,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_type integer NOT NULL,
    fk_account integer,
    fk_mode_reglement integer,
    amount real DEFAULT 0 NOT NULL,
    paye smallint DEFAULT 0 NOT NULL,
    periode date,
    fk_projet integer,
    import_key character varying(14)
);


ALTER TABLE public.llx_chargesociales OWNER TO postgres;

--
-- TOC entry 321 (class 1259 OID 835078)
-- Name: llx_chargesociales_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_chargesociales_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_chargesociales_rowid_seq OWNER TO postgres;

--
-- TOC entry 6506 (class 0 OID 0)
-- Dependencies: 321
-- Name: llx_chargesociales_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_chargesociales_rowid_seq OWNED BY public.llx_chargesociales.rowid;


--
-- TOC entry 322 (class 1259 OID 835080)
-- Name: llx_commande; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande (
    rowid integer NOT NULL,
    ref character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(255),
    ref_int character varying(255),
    ref_client character varying(255),
    fk_soc integer NOT NULL,
    fk_projet integer,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    date_creation timestamp without time zone,
    date_valid timestamp without time zone,
    date_cloture timestamp without time zone,
    date_commande date,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_user_cloture integer,
    source smallint,
    fk_statut smallint DEFAULT 0,
    amount_ht real DEFAULT 0,
    remise_percent real DEFAULT 0,
    remise_absolue real DEFAULT 0,
    remise real DEFAULT 0,
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    facture smallint DEFAULT 0,
    fk_account integer,
    fk_currency character varying(3),
    fk_cond_reglement integer,
    fk_mode_reglement integer,
    date_livraison date,
    fk_shipping_method integer,
    fk_warehouse integer,
    fk_availability integer,
    fk_input_reason integer,
    fk_delivery_address integer,
    fk_incoterms integer,
    location_incoterms character varying(255),
    import_key character varying(14),
    extraparams character varying(255),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_commande OWNER TO postgres;

--
-- TOC entry 323 (class 1259 OID 835103)
-- Name: llx_commande_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_commande_extrafields OWNER TO postgres;

--
-- TOC entry 324 (class 1259 OID 835107)
-- Name: llx_commande_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6507 (class 0 OID 0)
-- Dependencies: 324
-- Name: llx_commande_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_extrafields_rowid_seq OWNED BY public.llx_commande_extrafields.rowid;


--
-- TOC entry 325 (class 1259 OID 835109)
-- Name: llx_commande_fournisseur; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseur (
    rowid integer NOT NULL,
    ref character varying(255) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(64),
    ref_supplier character varying(255),
    fk_soc integer NOT NULL,
    fk_projet integer DEFAULT 0,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    date_creation timestamp without time zone,
    date_valid timestamp without time zone,
    date_approve timestamp without time zone,
    date_approve2 timestamp without time zone,
    date_commande date,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_user_approve integer,
    fk_user_approve2 integer,
    source smallint NOT NULL,
    fk_statut smallint DEFAULT 0,
    billed smallint DEFAULT 0,
    amount_ht real DEFAULT 0,
    remise_percent real DEFAULT 0,
    remise real DEFAULT 0,
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    date_livraison timestamp without time zone,
    fk_account integer,
    fk_cond_reglement integer,
    fk_mode_reglement integer,
    fk_input_method integer DEFAULT 0,
    fk_incoterms integer,
    location_incoterms character varying(255),
    import_key character varying(14),
    extraparams character varying(255),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_commande_fournisseur OWNER TO postgres;

--
-- TOC entry 326 (class 1259 OID 835133)
-- Name: llx_commande_fournisseur_dispatch; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseur_dispatch (
    rowid integer NOT NULL,
    fk_commande integer,
    fk_product integer,
    fk_commandefourndet integer,
    qty numeric,
    fk_entrepot integer,
    fk_user integer,
    comment character varying(255),
    batch character varying(30) DEFAULT NULL::character varying,
    eatby date,
    sellby date,
    status integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_commande_fournisseur_dispatch OWNER TO postgres;

--
-- TOC entry 327 (class 1259 OID 835141)
-- Name: llx_commande_fournisseur_dispatch_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseur_dispatch_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseur_dispatch_rowid_seq OWNER TO postgres;

--
-- TOC entry 6508 (class 0 OID 0)
-- Dependencies: 327
-- Name: llx_commande_fournisseur_dispatch_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseur_dispatch_rowid_seq OWNED BY public.llx_commande_fournisseur_dispatch.rowid;


--
-- TOC entry 328 (class 1259 OID 835143)
-- Name: llx_commande_fournisseur_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseur_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_commande_fournisseur_extrafields OWNER TO postgres;

--
-- TOC entry 329 (class 1259 OID 835147)
-- Name: llx_commande_fournisseur_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseur_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseur_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6509 (class 0 OID 0)
-- Dependencies: 329
-- Name: llx_commande_fournisseur_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseur_extrafields_rowid_seq OWNED BY public.llx_commande_fournisseur_extrafields.rowid;


--
-- TOC entry 330 (class 1259 OID 835149)
-- Name: llx_commande_fournisseur_log; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseur_log (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datelog timestamp without time zone,
    fk_commande integer NOT NULL,
    fk_statut smallint NOT NULL,
    fk_user integer NOT NULL,
    comment character varying(255)
);


ALTER TABLE public.llx_commande_fournisseur_log OWNER TO postgres;

--
-- TOC entry 331 (class 1259 OID 835153)
-- Name: llx_commande_fournisseur_log_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseur_log_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseur_log_rowid_seq OWNER TO postgres;

--
-- TOC entry 6510 (class 0 OID 0)
-- Dependencies: 331
-- Name: llx_commande_fournisseur_log_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseur_log_rowid_seq OWNED BY public.llx_commande_fournisseur_log.rowid;


--
-- TOC entry 332 (class 1259 OID 835155)
-- Name: llx_commande_fournisseur_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseur_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseur_rowid_seq OWNER TO postgres;

--
-- TOC entry 6511 (class 0 OID 0)
-- Dependencies: 332
-- Name: llx_commande_fournisseur_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseur_rowid_seq OWNED BY public.llx_commande_fournisseur.rowid;


--
-- TOC entry 333 (class 1259 OID 835157)
-- Name: llx_commande_fournisseurdet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseurdet (
    rowid integer NOT NULL,
    fk_commande integer NOT NULL,
    fk_parent_line integer,
    fk_product integer,
    ref character varying(50),
    label character varying(255),
    description text,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3) DEFAULT 0,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    qty real,
    remise_percent real DEFAULT 0,
    remise real DEFAULT 0,
    subprice numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_tva numeric(24,8) DEFAULT 0,
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    product_type integer DEFAULT 0,
    date_start timestamp without time zone,
    date_end timestamp without time zone,
    info_bits integer DEFAULT 0,
    special_code integer DEFAULT 0,
    rang integer DEFAULT 0,
    import_key character varying(14),
    fk_unit integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_commande_fournisseurdet OWNER TO postgres;

--
-- TOC entry 334 (class 1259 OID 835183)
-- Name: llx_commande_fournisseurdet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commande_fournisseurdet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_commande_fournisseurdet_extrafields OWNER TO postgres;

--
-- TOC entry 335 (class 1259 OID 835187)
-- Name: llx_commande_fournisseurdet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseurdet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseurdet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6512 (class 0 OID 0)
-- Dependencies: 335
-- Name: llx_commande_fournisseurdet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseurdet_extrafields_rowid_seq OWNED BY public.llx_commande_fournisseurdet_extrafields.rowid;


--
-- TOC entry 336 (class 1259 OID 835189)
-- Name: llx_commande_fournisseurdet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_fournisseurdet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_fournisseurdet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6513 (class 0 OID 0)
-- Dependencies: 336
-- Name: llx_commande_fournisseurdet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_fournisseurdet_rowid_seq OWNED BY public.llx_commande_fournisseurdet.rowid;


--
-- TOC entry 337 (class 1259 OID 835191)
-- Name: llx_commande_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commande_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commande_rowid_seq OWNER TO postgres;

--
-- TOC entry 6514 (class 0 OID 0)
-- Dependencies: 337
-- Name: llx_commande_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commande_rowid_seq OWNED BY public.llx_commande.rowid;


--
-- TOC entry 338 (class 1259 OID 835193)
-- Name: llx_commandedet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commandedet (
    rowid integer NOT NULL,
    fk_commande integer NOT NULL,
    fk_parent_line integer,
    fk_product integer,
    label character varying(255) DEFAULT NULL::character varying,
    description text,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3),
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    qty real,
    remise_percent real DEFAULT 0,
    remise real DEFAULT 0,
    fk_remise_except integer,
    price real,
    subprice numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_tva numeric(24,8) DEFAULT 0,
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    product_type integer DEFAULT 0,
    date_start timestamp without time zone,
    date_end timestamp without time zone,
    info_bits integer DEFAULT 0,
    buy_price_ht numeric(24,8) DEFAULT 0,
    fk_product_fournisseur_price integer,
    special_code integer DEFAULT 0,
    rang integer DEFAULT 0,
    fk_unit integer,
    import_key character varying(14),
    fk_commandefourndet integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_commandedet OWNER TO postgres;

--
-- TOC entry 339 (class 1259 OID 835220)
-- Name: llx_commandedet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_commandedet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_commandedet_extrafields OWNER TO postgres;

--
-- TOC entry 340 (class 1259 OID 835224)
-- Name: llx_commandedet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commandedet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commandedet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6515 (class 0 OID 0)
-- Dependencies: 340
-- Name: llx_commandedet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commandedet_extrafields_rowid_seq OWNED BY public.llx_commandedet_extrafields.rowid;


--
-- TOC entry 341 (class 1259 OID 835226)
-- Name: llx_commandedet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_commandedet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_commandedet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6516 (class 0 OID 0)
-- Dependencies: 341
-- Name: llx_commandedet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_commandedet_rowid_seq OWNED BY public.llx_commandedet.rowid;


--
-- TOC entry 342 (class 1259 OID 835228)
-- Name: llx_const; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_const (
    rowid integer NOT NULL,
    name character varying(255) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    value text NOT NULL,
    type character varying(6),
    visible smallint DEFAULT 1 NOT NULL,
    note text,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_const OWNER TO postgres;

--
-- TOC entry 343 (class 1259 OID 835237)
-- Name: llx_const_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_const_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_const_rowid_seq OWNER TO postgres;

--
-- TOC entry 6517 (class 0 OID 0)
-- Dependencies: 343
-- Name: llx_const_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_const_rowid_seq OWNED BY public.llx_const.rowid;


--
-- TOC entry 344 (class 1259 OID 835239)
-- Name: llx_contrat; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_contrat (
    rowid integer NOT NULL,
    ref character varying(30),
    ref_customer character varying(30),
    ref_supplier character varying(30),
    ref_ext character varying(30),
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    date_contrat timestamp without time zone,
    statut smallint DEFAULT 0,
    mise_en_service timestamp without time zone,
    fin_validite timestamp without time zone,
    date_cloture timestamp without time zone,
    fk_soc integer NOT NULL,
    fk_projet integer,
    fk_commercial_signature integer,
    fk_commercial_suivi integer,
    fk_user_author integer DEFAULT 0 NOT NULL,
    fk_user_modif integer,
    fk_user_mise_en_service integer,
    fk_user_cloture integer,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    import_key character varying(14),
    extraparams character varying(255)
);


ALTER TABLE public.llx_contrat OWNER TO postgres;

--
-- TOC entry 345 (class 1259 OID 835249)
-- Name: llx_contrat_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_contrat_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_contrat_extrafields OWNER TO postgres;

--
-- TOC entry 346 (class 1259 OID 835253)
-- Name: llx_contrat_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_contrat_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_contrat_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6518 (class 0 OID 0)
-- Dependencies: 346
-- Name: llx_contrat_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_contrat_extrafields_rowid_seq OWNED BY public.llx_contrat_extrafields.rowid;


--
-- TOC entry 347 (class 1259 OID 835255)
-- Name: llx_contrat_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_contrat_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_contrat_rowid_seq OWNER TO postgres;

--
-- TOC entry 6519 (class 0 OID 0)
-- Dependencies: 347
-- Name: llx_contrat_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_contrat_rowid_seq OWNED BY public.llx_contrat.rowid;


--
-- TOC entry 348 (class 1259 OID 835257)
-- Name: llx_contratdet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_contratdet (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_contrat integer NOT NULL,
    fk_product integer,
    statut smallint DEFAULT 0,
    label text,
    description text,
    fk_remise_except integer,
    date_commande timestamp without time zone,
    date_ouverture_prevue timestamp without time zone,
    date_ouverture timestamp without time zone,
    date_fin_validite timestamp without time zone,
    date_cloture timestamp without time zone,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3) DEFAULT 0,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    qty real NOT NULL,
    remise_percent real DEFAULT 0,
    subprice numeric(24,8) DEFAULT 0,
    price_ht real,
    remise real DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_tva numeric(24,8) DEFAULT 0,
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    product_type integer DEFAULT 1,
    info_bits integer DEFAULT 0,
    buy_price_ht numeric(24,8) DEFAULT NULL::numeric,
    fk_product_fournisseur_price integer,
    fk_user_author integer DEFAULT 0 NOT NULL,
    fk_user_ouverture integer,
    fk_user_cloture integer,
    commentaire text,
    fk_unit integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_contratdet OWNER TO postgres;

--
-- TOC entry 349 (class 1259 OID 835285)
-- Name: llx_contratdet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_contratdet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_contratdet_extrafields OWNER TO postgres;

--
-- TOC entry 350 (class 1259 OID 835289)
-- Name: llx_contratdet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_contratdet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_contratdet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6520 (class 0 OID 0)
-- Dependencies: 350
-- Name: llx_contratdet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_contratdet_extrafields_rowid_seq OWNED BY public.llx_contratdet_extrafields.rowid;


--
-- TOC entry 351 (class 1259 OID 835291)
-- Name: llx_contratdet_log; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_contratdet_log (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_contratdet integer NOT NULL,
    date timestamp without time zone,
    statut smallint NOT NULL,
    fk_user_author integer NOT NULL,
    commentaire text
);


ALTER TABLE public.llx_contratdet_log OWNER TO postgres;

--
-- TOC entry 352 (class 1259 OID 835298)
-- Name: llx_contratdet_log_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_contratdet_log_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_contratdet_log_rowid_seq OWNER TO postgres;

--
-- TOC entry 6521 (class 0 OID 0)
-- Dependencies: 352
-- Name: llx_contratdet_log_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_contratdet_log_rowid_seq OWNED BY public.llx_contratdet_log.rowid;


--
-- TOC entry 353 (class 1259 OID 835300)
-- Name: llx_contratdet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_contratdet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_contratdet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6522 (class 0 OID 0)
-- Dependencies: 353
-- Name: llx_contratdet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_contratdet_rowid_seq OWNED BY public.llx_contratdet.rowid;


--
-- TOC entry 354 (class 1259 OID 835302)
-- Name: llx_cronjob; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_cronjob (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    jobtype character varying(10) NOT NULL,
    label text NOT NULL,
    command character varying(255),
    classesname character varying(255),
    objectname character varying(255),
    methodename character varying(255),
    params text,
    md5params character varying(32),
    module_name character varying(255),
    priority integer DEFAULT 0,
    datelastrun timestamp without time zone,
    datenextrun timestamp without time zone,
    datestart timestamp without time zone,
    dateend timestamp without time zone,
    datelastresult timestamp without time zone,
    lastresult text,
    lastoutput text,
    unitfrequency character varying(255) DEFAULT '3600'::character varying NOT NULL,
    frequency integer DEFAULT 0 NOT NULL,
    maxrun integer DEFAULT 0 NOT NULL,
    nbrun integer,
    autodelete integer DEFAULT 0,
    status integer DEFAULT 1 NOT NULL,
    processing integer DEFAULT 0 NOT NULL,
    test character varying(255) DEFAULT '1'::character varying,
    fk_user_author integer,
    fk_user_mod integer,
    fk_mailing integer,
    note text,
    libname character varying(255),
    entity integer DEFAULT 0
);


ALTER TABLE public.llx_cronjob OWNER TO postgres;

--
-- TOC entry 355 (class 1259 OID 835318)
-- Name: llx_cronjob_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_cronjob_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_cronjob_rowid_seq OWNER TO postgres;

--
-- TOC entry 6523 (class 0 OID 0)
-- Dependencies: 355
-- Name: llx_cronjob_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_cronjob_rowid_seq OWNED BY public.llx_cronjob.rowid;


--
-- TOC entry 356 (class 1259 OID 835320)
-- Name: llx_default_values; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_default_values (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    type character varying(10),
    user_id integer DEFAULT 0 NOT NULL,
    page character varying(255),
    param character varying(255),
    value character varying(128)
);


ALTER TABLE public.llx_default_values OWNER TO postgres;

--
-- TOC entry 357 (class 1259 OID 835328)
-- Name: llx_default_values_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_default_values_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_default_values_rowid_seq OWNER TO postgres;

--
-- TOC entry 6524 (class 0 OID 0)
-- Dependencies: 357
-- Name: llx_default_values_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_default_values_rowid_seq OWNED BY public.llx_default_values.rowid;


--
-- TOC entry 358 (class 1259 OID 835330)
-- Name: llx_deplacement; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_deplacement (
    rowid integer NOT NULL,
    ref character varying(30) DEFAULT NULL::character varying,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    dated timestamp without time zone,
    fk_user integer NOT NULL,
    fk_user_author integer,
    fk_user_modif integer,
    type character varying(12) NOT NULL,
    fk_statut integer DEFAULT 1 NOT NULL,
    km real,
    fk_soc integer,
    fk_projet integer DEFAULT 0,
    note_private text,
    note_public text,
    extraparams character varying(255)
);


ALTER TABLE public.llx_deplacement OWNER TO postgres;

--
-- TOC entry 359 (class 1259 OID 835341)
-- Name: llx_deplacement_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_deplacement_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_deplacement_rowid_seq OWNER TO postgres;

--
-- TOC entry 6525 (class 0 OID 0)
-- Dependencies: 359
-- Name: llx_deplacement_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_deplacement_rowid_seq OWNED BY public.llx_deplacement.rowid;


--
-- TOC entry 360 (class 1259 OID 835343)
-- Name: llx_document_model; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_document_model (
    rowid integer NOT NULL,
    nom character varying(50),
    entity integer DEFAULT 1 NOT NULL,
    type character varying(20) NOT NULL,
    libelle character varying(255),
    description text
);


ALTER TABLE public.llx_document_model OWNER TO postgres;

--
-- TOC entry 361 (class 1259 OID 835350)
-- Name: llx_document_model_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_document_model_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_document_model_rowid_seq OWNER TO postgres;

--
-- TOC entry 6526 (class 0 OID 0)
-- Dependencies: 361
-- Name: llx_document_model_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_document_model_rowid_seq OWNED BY public.llx_document_model.rowid;


--
-- TOC entry 362 (class 1259 OID 835352)
-- Name: llx_don; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_don (
    rowid integer NOT NULL,
    ref character varying(30) DEFAULT NULL::character varying,
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_statut smallint DEFAULT 0 NOT NULL,
    datedon timestamp without time zone,
    amount real DEFAULT 0,
    fk_payment integer,
    paid smallint DEFAULT 0 NOT NULL,
    firstname character varying(50),
    lastname character varying(50),
    societe character varying(50),
    address text,
    zip character varying(30),
    town character varying(50),
    country character varying(50),
    fk_country integer NOT NULL,
    email character varying(255),
    phone character varying(24),
    phone_mobile character varying(24),
    public smallint DEFAULT 1 NOT NULL,
    fk_projet integer,
    datec timestamp without time zone,
    fk_user_author integer NOT NULL,
    date_valid timestamp without time zone,
    fk_user_valid integer,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    import_key character varying(14)
);


ALTER TABLE public.llx_don OWNER TO postgres;

--
-- TOC entry 363 (class 1259 OID 835365)
-- Name: llx_don_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_don_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_don_extrafields OWNER TO postgres;

--
-- TOC entry 364 (class 1259 OID 835369)
-- Name: llx_don_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_don_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_don_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6527 (class 0 OID 0)
-- Dependencies: 364
-- Name: llx_don_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_don_extrafields_rowid_seq OWNED BY public.llx_don_extrafields.rowid;


--
-- TOC entry 365 (class 1259 OID 835371)
-- Name: llx_don_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_don_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_don_rowid_seq OWNER TO postgres;

--
-- TOC entry 6528 (class 0 OID 0)
-- Dependencies: 365
-- Name: llx_don_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_don_rowid_seq OWNED BY public.llx_don.rowid;


--
-- TOC entry 366 (class 1259 OID 835373)
-- Name: llx_ecm_directories; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_ecm_directories (
    rowid integer NOT NULL,
    label character varying(64) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_parent integer,
    description character varying(255) NOT NULL,
    cachenbofdoc integer DEFAULT 0 NOT NULL,
    fullpath character varying(750),
    extraparams character varying(255),
    date_c timestamp without time zone,
    date_m timestamp without time zone,
    fk_user_c integer,
    fk_user_m integer,
    acl text
);


ALTER TABLE public.llx_ecm_directories OWNER TO postgres;

--
-- TOC entry 367 (class 1259 OID 835381)
-- Name: llx_ecm_directories_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_ecm_directories_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_ecm_directories_rowid_seq OWNER TO postgres;

--
-- TOC entry 6529 (class 0 OID 0)
-- Dependencies: 367
-- Name: llx_ecm_directories_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_ecm_directories_rowid_seq OWNED BY public.llx_ecm_directories.rowid;


--
-- TOC entry 368 (class 1259 OID 835383)
-- Name: llx_ecm_files; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_ecm_files (
    rowid integer NOT NULL,
    ref character varying(128),
    label character varying(64) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    filepath character varying(255) NOT NULL,
    filename character varying(255) NOT NULL,
    fullpath_orig character varying(750),
    description text,
    keywords character varying(750),
    cover text,
    "position" integer,
    gen_or_uploaded character varying(12),
    extraparams character varying(255),
    date_c timestamp without time zone,
    date_m timestamp without time zone,
    fk_user_c integer,
    fk_user_m integer,
    acl text
);


ALTER TABLE public.llx_ecm_files OWNER TO postgres;

--
-- TOC entry 369 (class 1259 OID 835390)
-- Name: llx_ecm_files_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_ecm_files_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_ecm_files_rowid_seq OWNER TO postgres;

--
-- TOC entry 6530 (class 0 OID 0)
-- Dependencies: 369
-- Name: llx_ecm_files_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_ecm_files_rowid_seq OWNED BY public.llx_ecm_files.rowid;


--
-- TOC entry 370 (class 1259 OID 835392)
-- Name: llx_element_contact; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_element_contact (
    rowid integer NOT NULL,
    datecreate timestamp without time zone,
    statut smallint DEFAULT 5,
    element_id integer NOT NULL,
    fk_c_type_contact integer NOT NULL,
    fk_socpeople integer NOT NULL
);


ALTER TABLE public.llx_element_contact OWNER TO postgres;

--
-- TOC entry 371 (class 1259 OID 835396)
-- Name: llx_element_contact_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_element_contact_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_element_contact_rowid_seq OWNER TO postgres;

--
-- TOC entry 6531 (class 0 OID 0)
-- Dependencies: 371
-- Name: llx_element_contact_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_element_contact_rowid_seq OWNED BY public.llx_element_contact.rowid;


--
-- TOC entry 372 (class 1259 OID 835398)
-- Name: llx_element_element; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_element_element (
    rowid integer NOT NULL,
    fk_source integer NOT NULL,
    sourcetype character varying(32) NOT NULL,
    fk_target integer NOT NULL,
    targettype character varying(32) NOT NULL
);


ALTER TABLE public.llx_element_element OWNER TO postgres;

--
-- TOC entry 373 (class 1259 OID 835401)
-- Name: llx_element_element_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_element_element_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_element_element_rowid_seq OWNER TO postgres;

--
-- TOC entry 6532 (class 0 OID 0)
-- Dependencies: 373
-- Name: llx_element_element_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_element_element_rowid_seq OWNED BY public.llx_element_element.rowid;


--
-- TOC entry 374 (class 1259 OID 835403)
-- Name: llx_element_resources; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_element_resources (
    rowid integer NOT NULL,
    element_id integer,
    element_type character varying(64),
    resource_id integer,
    resource_type character varying(64),
    busy integer,
    mandatory integer,
    duree real,
    fk_user_create integer,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_element_resources OWNER TO postgres;

--
-- TOC entry 375 (class 1259 OID 835407)
-- Name: llx_element_resources_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_element_resources_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_element_resources_rowid_seq OWNER TO postgres;

--
-- TOC entry 6533 (class 0 OID 0)
-- Dependencies: 375
-- Name: llx_element_resources_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_element_resources_rowid_seq OWNED BY public.llx_element_resources.rowid;


--
-- TOC entry 376 (class 1259 OID 835409)
-- Name: llx_element_tag; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_element_tag (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    lang character varying(5) NOT NULL,
    tag character varying(255) NOT NULL,
    fk_element integer NOT NULL,
    element character varying(64) NOT NULL
);


ALTER TABLE public.llx_element_tag OWNER TO postgres;

--
-- TOC entry 377 (class 1259 OID 835413)
-- Name: llx_element_tag_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_element_tag_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_element_tag_rowid_seq OWNER TO postgres;

--
-- TOC entry 6534 (class 0 OID 0)
-- Dependencies: 377
-- Name: llx_element_tag_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_element_tag_rowid_seq OWNED BY public.llx_element_tag.rowid;


--
-- TOC entry 378 (class 1259 OID 835415)
-- Name: llx_entrepot; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_entrepot (
    rowid integer NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    label character varying(255) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    description text,
    lieu character varying(64),
    address character varying(255),
    zip character varying(10),
    town character varying(50),
    fk_departement integer,
    fk_pays integer DEFAULT 0,
    statut smallint DEFAULT 1,
    fk_user_author integer,
    import_key character varying(14),
    fk_parent integer DEFAULT 0
);


ALTER TABLE public.llx_entrepot OWNER TO postgres;

--
-- TOC entry 379 (class 1259 OID 835426)
-- Name: llx_entrepot_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_entrepot_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_entrepot_rowid_seq OWNER TO postgres;

--
-- TOC entry 6535 (class 0 OID 0)
-- Dependencies: 379
-- Name: llx_entrepot_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_entrepot_rowid_seq OWNED BY public.llx_entrepot.rowid;


--
-- TOC entry 380 (class 1259 OID 835428)
-- Name: llx_establishment; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_establishment (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    name character varying(50),
    address character varying(255),
    zip character varying(25),
    town character varying(50),
    fk_state integer DEFAULT 0,
    fk_country integer DEFAULT 0,
    profid1 character varying(20),
    profid2 character varying(20),
    profid3 character varying(20),
    phone character varying(20),
    fk_user_author integer NOT NULL,
    fk_user_mod integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    status smallint DEFAULT 1
);


ALTER TABLE public.llx_establishment OWNER TO postgres;

--
-- TOC entry 381 (class 1259 OID 835436)
-- Name: llx_establishment_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_establishment_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_establishment_rowid_seq OWNER TO postgres;

--
-- TOC entry 6536 (class 0 OID 0)
-- Dependencies: 381
-- Name: llx_establishment_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_establishment_rowid_seq OWNED BY public.llx_establishment.rowid;


--
-- TOC entry 382 (class 1259 OID 835438)
-- Name: llx_event_element; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_event_element (
    rowid integer NOT NULL,
    fk_source integer NOT NULL,
    fk_target integer NOT NULL,
    targettype character varying(32) NOT NULL
);


ALTER TABLE public.llx_event_element OWNER TO postgres;

--
-- TOC entry 383 (class 1259 OID 835441)
-- Name: llx_event_element_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_event_element_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_event_element_rowid_seq OWNER TO postgres;

--
-- TOC entry 6537 (class 0 OID 0)
-- Dependencies: 383
-- Name: llx_event_element_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_event_element_rowid_seq OWNED BY public.llx_event_element.rowid;


--
-- TOC entry 384 (class 1259 OID 835443)
-- Name: llx_events; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_events (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    type character varying(32) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    dateevent timestamp without time zone,
    fk_user integer,
    description character varying(250) NOT NULL,
    ip character varying(250) NOT NULL,
    user_agent character varying(255),
    fk_object integer
);


ALTER TABLE public.llx_events OWNER TO postgres;

--
-- TOC entry 385 (class 1259 OID 835451)
-- Name: llx_events_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_events_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_events_rowid_seq OWNER TO postgres;

--
-- TOC entry 6538 (class 0 OID 0)
-- Dependencies: 385
-- Name: llx_events_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_events_rowid_seq OWNED BY public.llx_events.rowid;


--
-- TOC entry 386 (class 1259 OID 835453)
-- Name: llx_expedition; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expedition (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    ref character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_soc integer NOT NULL,
    fk_projet integer,
    ref_ext character varying(30),
    ref_int character varying(30),
    ref_customer character varying(30),
    date_creation timestamp without time zone,
    fk_user_author integer,
    fk_user_modif integer,
    date_valid timestamp without time zone,
    fk_user_valid integer,
    date_delivery timestamp without time zone,
    date_expedition timestamp without time zone,
    fk_address integer,
    fk_shipping_method integer,
    tracking_number character varying(50),
    fk_statut smallint DEFAULT 0,
    billed smallint DEFAULT 0,
    height numeric,
    width numeric,
    size_units integer,
    size numeric,
    weight_units integer,
    weight numeric,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    fk_incoterms integer,
    location_incoterms character varying(255),
    import_key character varying(14),
    extraparams character varying(255)
);


ALTER TABLE public.llx_expedition OWNER TO postgres;

--
-- TOC entry 387 (class 1259 OID 835463)
-- Name: llx_expedition_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expedition_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_expedition_extrafields OWNER TO postgres;

--
-- TOC entry 388 (class 1259 OID 835467)
-- Name: llx_expedition_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expedition_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expedition_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6539 (class 0 OID 0)
-- Dependencies: 388
-- Name: llx_expedition_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expedition_extrafields_rowid_seq OWNED BY public.llx_expedition_extrafields.rowid;


--
-- TOC entry 389 (class 1259 OID 835469)
-- Name: llx_expedition_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expedition_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expedition_rowid_seq OWNER TO postgres;

--
-- TOC entry 6540 (class 0 OID 0)
-- Dependencies: 389
-- Name: llx_expedition_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expedition_rowid_seq OWNED BY public.llx_expedition.rowid;


--
-- TOC entry 390 (class 1259 OID 835471)
-- Name: llx_expeditiondet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expeditiondet (
    rowid integer NOT NULL,
    fk_expedition integer NOT NULL,
    fk_origin_line integer,
    fk_entrepot integer,
    qty real,
    rang integer DEFAULT 0
);


ALTER TABLE public.llx_expeditiondet OWNER TO postgres;

--
-- TOC entry 391 (class 1259 OID 835475)
-- Name: llx_expeditiondet_batch; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expeditiondet_batch (
    rowid integer NOT NULL,
    fk_expeditiondet integer NOT NULL,
    eatby date,
    sellby date,
    batch character varying(30) DEFAULT NULL::character varying,
    qty numeric DEFAULT '0'::numeric NOT NULL,
    fk_origin_stock integer NOT NULL
);


ALTER TABLE public.llx_expeditiondet_batch OWNER TO postgres;

--
-- TOC entry 392 (class 1259 OID 835483)
-- Name: llx_expeditiondet_batch_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expeditiondet_batch_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expeditiondet_batch_rowid_seq OWNER TO postgres;

--
-- TOC entry 6541 (class 0 OID 0)
-- Dependencies: 392
-- Name: llx_expeditiondet_batch_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expeditiondet_batch_rowid_seq OWNED BY public.llx_expeditiondet_batch.rowid;


--
-- TOC entry 393 (class 1259 OID 835485)
-- Name: llx_expeditiondet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expeditiondet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_expeditiondet_extrafields OWNER TO postgres;

--
-- TOC entry 394 (class 1259 OID 835489)
-- Name: llx_expeditiondet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expeditiondet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expeditiondet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6542 (class 0 OID 0)
-- Dependencies: 394
-- Name: llx_expeditiondet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expeditiondet_extrafields_rowid_seq OWNED BY public.llx_expeditiondet_extrafields.rowid;


--
-- TOC entry 395 (class 1259 OID 835491)
-- Name: llx_expeditiondet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expeditiondet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expeditiondet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6543 (class 0 OID 0)
-- Dependencies: 395
-- Name: llx_expeditiondet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expeditiondet_rowid_seq OWNED BY public.llx_expeditiondet.rowid;


--
-- TOC entry 396 (class 1259 OID 835493)
-- Name: llx_expensereport; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expensereport (
    rowid integer NOT NULL,
    ref character varying(50) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_number_int integer,
    ref_ext integer,
    total_ht numeric(24,8) DEFAULT 0,
    total_tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    date_debut date NOT NULL,
    date_fin date NOT NULL,
    date_create timestamp without time zone,
    date_valid timestamp without time zone,
    date_approve timestamp without time zone,
    date_refuse timestamp without time zone,
    date_cancel timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_author integer NOT NULL,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_user_validator integer,
    fk_user_approve integer,
    fk_user_refuse integer,
    fk_user_cancel integer,
    fk_statut integer NOT NULL,
    fk_c_paiement integer,
    paid smallint DEFAULT 0 NOT NULL,
    note_public text,
    note_private text,
    detail_refuse character varying(255) DEFAULT NULL::character varying,
    detail_cancel character varying(255) DEFAULT NULL::character varying,
    integration_compta integer,
    fk_bank_account integer,
    model_pdf character varying(50) DEFAULT NULL::character varying,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0,
    import_key character varying(14),
    extraparams character varying(255)
);


ALTER TABLE public.llx_expensereport OWNER TO postgres;

--
-- TOC entry 397 (class 1259 OID 835514)
-- Name: llx_expensereport_det; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expensereport_det (
    rowid integer NOT NULL,
    fk_expensereport integer NOT NULL,
    fk_c_type_fees integer NOT NULL,
    fk_projet integer,
    comments text NOT NULL,
    product_type integer DEFAULT '-1'::integer,
    qty real NOT NULL,
    value_unit real NOT NULL,
    remise_percent real,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3),
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    total_ht numeric(24,8) DEFAULT 0 NOT NULL,
    total_tva numeric(24,8) DEFAULT 0 NOT NULL,
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0 NOT NULL,
    date date NOT NULL,
    info_bits integer DEFAULT 0,
    special_code integer DEFAULT 0,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0,
    fk_facture integer DEFAULT 0,
    fk_code_ventilation integer DEFAULT 0,
    rang integer DEFAULT 0,
    import_key character varying(14)
);


ALTER TABLE public.llx_expensereport_det OWNER TO postgres;

--
-- TOC entry 398 (class 1259 OID 835538)
-- Name: llx_expensereport_det_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expensereport_det_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expensereport_det_rowid_seq OWNER TO postgres;

--
-- TOC entry 6544 (class 0 OID 0)
-- Dependencies: 398
-- Name: llx_expensereport_det_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expensereport_det_rowid_seq OWNED BY public.llx_expensereport_det.rowid;


--
-- TOC entry 399 (class 1259 OID 835540)
-- Name: llx_expensereport_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_expensereport_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_expensereport_extrafields OWNER TO postgres;

--
-- TOC entry 400 (class 1259 OID 835544)
-- Name: llx_expensereport_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expensereport_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expensereport_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6545 (class 0 OID 0)
-- Dependencies: 400
-- Name: llx_expensereport_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expensereport_extrafields_rowid_seq OWNED BY public.llx_expensereport_extrafields.rowid;


--
-- TOC entry 401 (class 1259 OID 835546)
-- Name: llx_expensereport_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_expensereport_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_expensereport_rowid_seq OWNER TO postgres;

--
-- TOC entry 6546 (class 0 OID 0)
-- Dependencies: 401
-- Name: llx_expensereport_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_expensereport_rowid_seq OWNED BY public.llx_expensereport.rowid;


--
-- TOC entry 402 (class 1259 OID 835548)
-- Name: llx_export_compta; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_export_compta (
    rowid integer NOT NULL,
    ref character varying(12) NOT NULL,
    date_export timestamp without time zone,
    fk_user integer NOT NULL,
    note text
);


ALTER TABLE public.llx_export_compta OWNER TO postgres;

--
-- TOC entry 403 (class 1259 OID 835554)
-- Name: llx_export_compta_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_export_compta_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_export_compta_rowid_seq OWNER TO postgres;

--
-- TOC entry 6547 (class 0 OID 0)
-- Dependencies: 403
-- Name: llx_export_compta_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_export_compta_rowid_seq OWNED BY public.llx_export_compta.rowid;


--
-- TOC entry 404 (class 1259 OID 835556)
-- Name: llx_export_model; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_export_model (
    rowid integer NOT NULL,
    fk_user integer DEFAULT 0 NOT NULL,
    label character varying(50) NOT NULL,
    type character varying(20) NOT NULL,
    field text NOT NULL,
    filter text
);


ALTER TABLE public.llx_export_model OWNER TO postgres;

--
-- TOC entry 405 (class 1259 OID 835563)
-- Name: llx_export_model_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_export_model_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_export_model_rowid_seq OWNER TO postgres;

--
-- TOC entry 6548 (class 0 OID 0)
-- Dependencies: 405
-- Name: llx_export_model_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_export_model_rowid_seq OWNED BY public.llx_export_model.rowid;


--
-- TOC entry 406 (class 1259 OID 835565)
-- Name: llx_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_extrafields (
    rowid integer NOT NULL,
    name character varying(64) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    elementtype character varying(64) DEFAULT 'member'::character varying NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    label character varying(255) NOT NULL,
    type character varying(8),
    size character varying(8) DEFAULT NULL::character varying,
    fieldcomputed text,
    fielddefault character varying(255),
    fieldunique integer DEFAULT 0,
    fieldrequired integer DEFAULT 0,
    perms character varying(255),
    pos integer DEFAULT 0,
    alwayseditable integer DEFAULT 0,
    param text,
    list integer DEFAULT 0,
    langs character varying(24),
    ishidden integer DEFAULT 0
);


ALTER TABLE public.llx_extrafields OWNER TO postgres;

--
-- TOC entry 407 (class 1259 OID 835581)
-- Name: llx_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6549 (class 0 OID 0)
-- Dependencies: 407
-- Name: llx_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_extrafields_rowid_seq OWNED BY public.llx_extrafields.rowid;


--
-- TOC entry 408 (class 1259 OID 835583)
-- Name: llx_facture; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture (
    rowid integer NOT NULL,
    facnumber character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(255),
    ref_int character varying(255),
    ref_client character varying(255),
    type smallint DEFAULT 0 NOT NULL,
    increment character varying(10),
    fk_soc integer NOT NULL,
    datec timestamp without time zone,
    datef date,
    date_pointoftax date,
    date_valid date,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    paye smallint DEFAULT 0 NOT NULL,
    amount numeric(24,8) DEFAULT 0 NOT NULL,
    remise_percent real DEFAULT 0,
    remise_absolue real DEFAULT 0,
    remise real DEFAULT 0,
    close_code character varying(16),
    close_note character varying(128),
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    revenuestamp numeric(24,8) DEFAULT 0,
    total numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    fk_statut smallint DEFAULT 0 NOT NULL,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_fac_rec_source integer,
    fk_facture_source integer,
    fk_projet integer,
    fk_account integer,
    fk_currency character varying(3),
    fk_cond_reglement integer DEFAULT 1 NOT NULL,
    fk_mode_reglement integer,
    date_lim_reglement date,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    fk_incoterms integer,
    location_incoterms character varying(255),
    situation_cycle_ref smallint,
    situation_counter smallint,
    situation_final smallint,
    import_key character varying(14),
    extraparams character varying(255),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_facture OWNER TO postgres;

--
-- TOC entry 409 (class 1259 OID 835609)
-- Name: llx_facture_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14),
    refdossier character varying(255),
    refcontrole character varying(255),
    date_controle date,
    adresse_controle text,
    type_controle character varying(255),
    date_debut_facturation date,
    date_fin_facturation date,
    kis_id_dossier character varying(255),
    kis_id_controle character varying(255),
    date_export_civil timestamp without time zone,
    date_export_pesv2 timestamp without time zone,
    nom_periode character varying(255),
    date_deliberation date,
    prefixe character varying(255),
    nom_occupant character varying(255),
    prenom_occupant character varying(255),
    civilite_occupant character varying(255)
);


ALTER TABLE public.llx_facture_extrafields OWNER TO postgres;

--
-- TOC entry 410 (class 1259 OID 835613)
-- Name: llx_facture_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6550 (class 0 OID 0)
-- Dependencies: 410
-- Name: llx_facture_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_extrafields_rowid_seq OWNED BY public.llx_facture_extrafields.rowid;


--
-- TOC entry 411 (class 1259 OID 835615)
-- Name: llx_facture_fourn; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_fourn (
    rowid integer NOT NULL,
    ref character varying(255) NOT NULL,
    ref_supplier character varying(255) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(255),
    type smallint DEFAULT 0 NOT NULL,
    fk_soc integer NOT NULL,
    datec timestamp without time zone,
    datef date,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    libelle character varying(255),
    paye smallint DEFAULT 0 NOT NULL,
    amount numeric(24,8) DEFAULT 0 NOT NULL,
    remise numeric(24,8) DEFAULT 0,
    close_code character varying(16),
    close_note character varying(128),
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    total numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    total_tva numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    fk_statut smallint DEFAULT 0 NOT NULL,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_facture_source integer,
    fk_projet integer,
    fk_account integer,
    fk_cond_reglement integer,
    fk_mode_reglement integer,
    date_lim_reglement date,
    note_private text,
    note_public text,
    fk_incoterms integer,
    location_incoterms character varying(255),
    model_pdf character varying(255),
    import_key character varying(14),
    extraparams character varying(255),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_facture_fourn OWNER TO postgres;

--
-- TOC entry 412 (class 1259 OID 835639)
-- Name: llx_facture_fourn_det; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_fourn_det (
    rowid integer NOT NULL,
    fk_facture_fourn integer NOT NULL,
    fk_parent_line integer,
    fk_product integer,
    ref character varying(50),
    label character varying(255),
    description text,
    pu_ht numeric(24,8),
    pu_ttc numeric(24,8),
    qty real,
    remise_percent real DEFAULT 0,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3),
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    total_ht numeric(24,8),
    tva numeric(24,8),
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8),
    product_type integer DEFAULT 0,
    date_start timestamp without time zone,
    date_end timestamp without time zone,
    info_bits integer DEFAULT 0,
    fk_code_ventilation integer DEFAULT 0 NOT NULL,
    special_code integer DEFAULT 0,
    rang integer DEFAULT 0,
    import_key character varying(14),
    fk_unit integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_facture_fourn_det OWNER TO postgres;

--
-- TOC entry 413 (class 1259 OID 835660)
-- Name: llx_facture_fourn_det_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_fourn_det_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_facture_fourn_det_extrafields OWNER TO postgres;

--
-- TOC entry 414 (class 1259 OID 835664)
-- Name: llx_facture_fourn_det_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_fourn_det_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_fourn_det_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6551 (class 0 OID 0)
-- Dependencies: 414
-- Name: llx_facture_fourn_det_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_fourn_det_extrafields_rowid_seq OWNED BY public.llx_facture_fourn_det_extrafields.rowid;


--
-- TOC entry 415 (class 1259 OID 835666)
-- Name: llx_facture_fourn_det_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_fourn_det_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_fourn_det_rowid_seq OWNER TO postgres;

--
-- TOC entry 6552 (class 0 OID 0)
-- Dependencies: 415
-- Name: llx_facture_fourn_det_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_fourn_det_rowid_seq OWNED BY public.llx_facture_fourn_det.rowid;


--
-- TOC entry 416 (class 1259 OID 835668)
-- Name: llx_facture_fourn_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_fourn_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_facture_fourn_extrafields OWNER TO postgres;

--
-- TOC entry 417 (class 1259 OID 835672)
-- Name: llx_facture_fourn_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_fourn_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_fourn_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6553 (class 0 OID 0)
-- Dependencies: 417
-- Name: llx_facture_fourn_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_fourn_extrafields_rowid_seq OWNED BY public.llx_facture_fourn_extrafields.rowid;


--
-- TOC entry 418 (class 1259 OID 835674)
-- Name: llx_facture_fourn_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_fourn_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_fourn_rowid_seq OWNER TO postgres;

--
-- TOC entry 6554 (class 0 OID 0)
-- Dependencies: 418
-- Name: llx_facture_fourn_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_fourn_rowid_seq OWNED BY public.llx_facture_fourn.rowid;


--
-- TOC entry 419 (class 1259 OID 835676)
-- Name: llx_facture_rec; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facture_rec (
    rowid integer NOT NULL,
    titre character varying(50) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_soc integer NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    amount numeric(24,8) DEFAULT 0 NOT NULL,
    remise real DEFAULT 0,
    remise_percent real DEFAULT 0,
    remise_absolue real DEFAULT 0,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    revenuestamp numeric(24,8) DEFAULT 0,
    total numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8) DEFAULT 0,
    fk_user_author integer,
    fk_user_modif integer,
    fk_projet integer,
    fk_cond_reglement integer DEFAULT 0,
    fk_mode_reglement integer DEFAULT 0,
    date_lim_reglement date,
    fk_account integer,
    note_private text,
    note_public text,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0,
    usenewprice integer DEFAULT 0,
    frequency integer,
    unit_frequency character varying(2) DEFAULT 'm'::character varying,
    date_when timestamp without time zone,
    date_last_gen timestamp without time zone,
    nb_gen_done integer,
    nb_gen_max integer,
    auto_validate integer DEFAULT 0
);


ALTER TABLE public.llx_facture_rec OWNER TO postgres;

--
-- TOC entry 420 (class 1259 OID 835704)
-- Name: llx_facture_rec_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_rec_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_rec_rowid_seq OWNER TO postgres;

--
-- TOC entry 6555 (class 0 OID 0)
-- Dependencies: 420
-- Name: llx_facture_rec_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_rec_rowid_seq OWNED BY public.llx_facture_rec.rowid;


--
-- TOC entry 421 (class 1259 OID 835706)
-- Name: llx_facture_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facture_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facture_rowid_seq OWNER TO postgres;

--
-- TOC entry 6556 (class 0 OID 0)
-- Dependencies: 421
-- Name: llx_facture_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facture_rowid_seq OWNED BY public.llx_facture.rowid;


--
-- TOC entry 422 (class 1259 OID 835708)
-- Name: llx_facturedet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facturedet (
    rowid integer NOT NULL,
    fk_facture integer NOT NULL,
    fk_parent_line integer,
    fk_product integer,
    label character varying(255) DEFAULT NULL::character varying,
    description text,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3),
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    qty real,
    remise_percent real DEFAULT 0,
    remise real DEFAULT 0,
    fk_remise_except integer,
    subprice numeric(24,8),
    price numeric(24,8),
    total_ht numeric(24,8),
    total_tva numeric(24,8),
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8),
    product_type integer DEFAULT 0,
    date_start timestamp without time zone,
    date_end timestamp without time zone,
    info_bits integer DEFAULT 0,
    buy_price_ht numeric(24,8) DEFAULT 0,
    fk_product_fournisseur_price integer,
    fk_code_ventilation integer DEFAULT 0 NOT NULL,
    special_code integer DEFAULT 0,
    rang integer DEFAULT 0,
    fk_contract_line integer,
    import_key character varying(14),
    situation_percent real,
    fk_prev_id integer,
    fk_unit integer,
    fk_user_author integer,
    fk_user_modif integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_facturedet OWNER TO postgres;

--
-- TOC entry 423 (class 1259 OID 835732)
-- Name: llx_facturedet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facturedet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_facturedet_extrafields OWNER TO postgres;

--
-- TOC entry 424 (class 1259 OID 835736)
-- Name: llx_facturedet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facturedet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facturedet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6557 (class 0 OID 0)
-- Dependencies: 424
-- Name: llx_facturedet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facturedet_extrafields_rowid_seq OWNED BY public.llx_facturedet_extrafields.rowid;


--
-- TOC entry 425 (class 1259 OID 835738)
-- Name: llx_facturedet_rec; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_facturedet_rec (
    rowid integer NOT NULL,
    fk_facture integer NOT NULL,
    fk_parent_line integer,
    fk_product integer,
    product_type integer DEFAULT 0,
    label character varying(255) DEFAULT NULL::character varying,
    description text,
    vat_src_code character varying(10) DEFAULT ''::character varying,
    tva_tx numeric(6,3),
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10),
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10),
    qty real,
    remise_percent real DEFAULT 0,
    remise real DEFAULT 0,
    subprice numeric(24,8),
    price numeric(24,8),
    total_ht numeric(24,8),
    total_tva numeric(24,8),
    total_localtax1 numeric(24,8) DEFAULT 0,
    total_localtax2 numeric(24,8) DEFAULT 0,
    total_ttc numeric(24,8),
    info_bits integer DEFAULT 0,
    special_code integer DEFAULT 0,
    rang integer DEFAULT 0,
    fk_contract_line integer,
    fk_unit integer,
    import_key character varying(14),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_subprice numeric(24,8) DEFAULT 0,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_facturedet_rec OWNER TO postgres;

--
-- TOC entry 426 (class 1259 OID 835760)
-- Name: llx_facturedet_rec_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facturedet_rec_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facturedet_rec_rowid_seq OWNER TO postgres;

--
-- TOC entry 6558 (class 0 OID 0)
-- Dependencies: 426
-- Name: llx_facturedet_rec_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facturedet_rec_rowid_seq OWNED BY public.llx_facturedet_rec.rowid;


--
-- TOC entry 427 (class 1259 OID 835762)
-- Name: llx_facturedet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_facturedet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_facturedet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6559 (class 0 OID 0)
-- Dependencies: 427
-- Name: llx_facturedet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_facturedet_rowid_seq OWNED BY public.llx_facturedet.rowid;


--
-- TOC entry 428 (class 1259 OID 835764)
-- Name: llx_fichinter; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_fichinter (
    rowid integer NOT NULL,
    fk_soc integer NOT NULL,
    fk_projet integer DEFAULT 0,
    fk_contrat integer DEFAULT 0,
    ref character varying(30) NOT NULL,
    ref_ext character varying(255),
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    date_valid timestamp without time zone,
    datei date,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_statut smallint DEFAULT 0,
    dateo date,
    datee date,
    datet date,
    duree real,
    description text,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    extraparams character varying(255)
);


ALTER TABLE public.llx_fichinter OWNER TO postgres;

--
-- TOC entry 429 (class 1259 OID 835775)
-- Name: llx_fichinter_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_fichinter_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_fichinter_extrafields OWNER TO postgres;

--
-- TOC entry 430 (class 1259 OID 835779)
-- Name: llx_fichinter_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_fichinter_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_fichinter_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6560 (class 0 OID 0)
-- Dependencies: 430
-- Name: llx_fichinter_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_fichinter_extrafields_rowid_seq OWNED BY public.llx_fichinter_extrafields.rowid;


--
-- TOC entry 431 (class 1259 OID 835781)
-- Name: llx_fichinter_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_fichinter_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_fichinter_rowid_seq OWNER TO postgres;

--
-- TOC entry 6561 (class 0 OID 0)
-- Dependencies: 431
-- Name: llx_fichinter_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_fichinter_rowid_seq OWNED BY public.llx_fichinter.rowid;


--
-- TOC entry 432 (class 1259 OID 835783)
-- Name: llx_fichinterdet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_fichinterdet (
    rowid integer NOT NULL,
    fk_fichinter integer,
    fk_parent_line integer,
    date timestamp without time zone,
    description text,
    duree integer,
    rang integer DEFAULT 0
);


ALTER TABLE public.llx_fichinterdet OWNER TO postgres;

--
-- TOC entry 433 (class 1259 OID 835790)
-- Name: llx_fichinterdet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_fichinterdet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_fichinterdet_extrafields OWNER TO postgres;

--
-- TOC entry 434 (class 1259 OID 835794)
-- Name: llx_fichinterdet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_fichinterdet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_fichinterdet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6562 (class 0 OID 0)
-- Dependencies: 434
-- Name: llx_fichinterdet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_fichinterdet_extrafields_rowid_seq OWNED BY public.llx_fichinterdet_extrafields.rowid;


--
-- TOC entry 435 (class 1259 OID 835796)
-- Name: llx_fichinterdet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_fichinterdet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_fichinterdet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6563 (class 0 OID 0)
-- Dependencies: 435
-- Name: llx_fichinterdet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_fichinterdet_rowid_seq OWNED BY public.llx_fichinterdet.rowid;


--
-- TOC entry 436 (class 1259 OID 835798)
-- Name: llx_holiday; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_holiday (
    rowid integer NOT NULL,
    ref character varying(30) NOT NULL,
    ref_ext character varying(255),
    entity integer DEFAULT 1 NOT NULL,
    fk_user integer NOT NULL,
    fk_user_create integer,
    fk_user_modif integer,
    fk_type integer NOT NULL,
    date_create timestamp without time zone,
    description character varying(255) NOT NULL,
    date_debut date NOT NULL,
    date_fin date NOT NULL,
    halfday integer DEFAULT 0,
    statut integer DEFAULT 1 NOT NULL,
    fk_validator integer NOT NULL,
    date_valid timestamp without time zone,
    fk_user_valid integer,
    date_refuse timestamp without time zone,
    fk_user_refuse integer,
    date_cancel timestamp without time zone,
    fk_user_cancel integer,
    detail_refuse character varying(250) DEFAULT NULL::character varying,
    note_private text,
    note_public text,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    import_key character varying(14),
    extraparams character varying(255)
);


ALTER TABLE public.llx_holiday OWNER TO postgres;

--
-- TOC entry 437 (class 1259 OID 835809)
-- Name: llx_holiday_config; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_holiday_config (
    rowid integer NOT NULL,
    name character varying(128) NOT NULL,
    value text
);


ALTER TABLE public.llx_holiday_config OWNER TO postgres;

--
-- TOC entry 438 (class 1259 OID 835815)
-- Name: llx_holiday_config_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_holiday_config_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_holiday_config_rowid_seq OWNER TO postgres;

--
-- TOC entry 6564 (class 0 OID 0)
-- Dependencies: 438
-- Name: llx_holiday_config_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_holiday_config_rowid_seq OWNED BY public.llx_holiday_config.rowid;


--
-- TOC entry 439 (class 1259 OID 835817)
-- Name: llx_holiday_logs; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_holiday_logs (
    rowid integer NOT NULL,
    date_action timestamp without time zone,
    fk_user_action integer NOT NULL,
    fk_user_update integer NOT NULL,
    fk_type integer NOT NULL,
    type_action character varying(255) NOT NULL,
    prev_solde character varying(255) NOT NULL,
    new_solde character varying(255) NOT NULL
);


ALTER TABLE public.llx_holiday_logs OWNER TO postgres;

--
-- TOC entry 440 (class 1259 OID 835823)
-- Name: llx_holiday_logs_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_holiday_logs_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_holiday_logs_rowid_seq OWNER TO postgres;

--
-- TOC entry 6565 (class 0 OID 0)
-- Dependencies: 440
-- Name: llx_holiday_logs_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_holiday_logs_rowid_seq OWNED BY public.llx_holiday_logs.rowid;


--
-- TOC entry 441 (class 1259 OID 835825)
-- Name: llx_holiday_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_holiday_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_holiday_rowid_seq OWNER TO postgres;

--
-- TOC entry 6566 (class 0 OID 0)
-- Dependencies: 441
-- Name: llx_holiday_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_holiday_rowid_seq OWNED BY public.llx_holiday.rowid;


--
-- TOC entry 442 (class 1259 OID 835827)
-- Name: llx_holiday_users; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_holiday_users (
    fk_user integer NOT NULL,
    fk_type integer NOT NULL,
    nb_holiday real DEFAULT '0'::real NOT NULL
);


ALTER TABLE public.llx_holiday_users OWNER TO postgres;

--
-- TOC entry 443 (class 1259 OID 835831)
-- Name: llx_import_model; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_import_model (
    rowid integer NOT NULL,
    fk_user integer DEFAULT 0 NOT NULL,
    label character varying(50) NOT NULL,
    type character varying(50) NOT NULL,
    field text NOT NULL
);


ALTER TABLE public.llx_import_model OWNER TO postgres;

--
-- TOC entry 444 (class 1259 OID 835838)
-- Name: llx_import_model_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_import_model_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_import_model_rowid_seq OWNER TO postgres;

--
-- TOC entry 6567 (class 0 OID 0)
-- Dependencies: 444
-- Name: llx_import_model_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_import_model_rowid_seq OWNED BY public.llx_import_model.rowid;


--
-- TOC entry 445 (class 1259 OID 835840)
-- Name: llx_inventory; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_inventory (
    rowid integer NOT NULL,
    entity integer DEFAULT 0,
    ref character varying(48),
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_warehouse integer DEFAULT 0,
    status integer DEFAULT 0,
    title character varying(255) NOT NULL,
    date_inventory timestamp without time zone,
    import_key character varying(14)
);


ALTER TABLE public.llx_inventory OWNER TO postgres;

--
-- TOC entry 446 (class 1259 OID 835847)
-- Name: llx_inventory_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_inventory_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_inventory_rowid_seq OWNER TO postgres;

--
-- TOC entry 6568 (class 0 OID 0)
-- Dependencies: 446
-- Name: llx_inventory_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_inventory_rowid_seq OWNED BY public.llx_inventory.rowid;


--
-- TOC entry 447 (class 1259 OID 835849)
-- Name: llx_inventorydet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_inventorydet (
    rowid integer NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_inventory integer DEFAULT 0,
    fk_warehouse integer DEFAULT 0,
    fk_product integer DEFAULT 0,
    batch character varying(30) DEFAULT NULL::character varying,
    qty_view numeric,
    qty_stock numeric,
    qty_regulated numeric,
    pmp numeric DEFAULT 0,
    pa numeric DEFAULT 0,
    new_pmp numeric DEFAULT 0
);


ALTER TABLE public.llx_inventorydet OWNER TO postgres;

--
-- TOC entry 448 (class 1259 OID 835863)
-- Name: llx_inventorydet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_inventorydet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_inventorydet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6569 (class 0 OID 0)
-- Dependencies: 448
-- Name: llx_inventorydet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_inventorydet_rowid_seq OWNED BY public.llx_inventorydet.rowid;


--
-- TOC entry 449 (class 1259 OID 835865)
-- Name: llx_links; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_links (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datea timestamp without time zone,
    url character varying(255) NOT NULL,
    label character varying(255) NOT NULL,
    objecttype character varying(255) NOT NULL,
    objectid integer NOT NULL
);


ALTER TABLE public.llx_links OWNER TO postgres;

--
-- TOC entry 450 (class 1259 OID 835872)
-- Name: llx_links_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_links_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_links_rowid_seq OWNER TO postgres;

--
-- TOC entry 6570 (class 0 OID 0)
-- Dependencies: 450
-- Name: llx_links_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_links_rowid_seq OWNED BY public.llx_links.rowid;


--
-- TOC entry 451 (class 1259 OID 835874)
-- Name: llx_livraison; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_livraison (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    ref character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    fk_soc integer NOT NULL,
    ref_ext character varying(30),
    ref_int character varying(30),
    ref_customer character varying(30),
    date_creation timestamp without time zone,
    fk_user_author integer,
    date_valid timestamp without time zone,
    fk_user_valid integer,
    date_delivery timestamp without time zone,
    fk_address integer,
    fk_statut smallint DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    fk_incoterms integer,
    location_incoterms character varying(255)
);


ALTER TABLE public.llx_livraison OWNER TO postgres;

--
-- TOC entry 452 (class 1259 OID 835884)
-- Name: llx_livraison_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_livraison_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_livraison_extrafields OWNER TO postgres;

--
-- TOC entry 453 (class 1259 OID 835888)
-- Name: llx_livraison_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_livraison_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_livraison_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6571 (class 0 OID 0)
-- Dependencies: 453
-- Name: llx_livraison_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_livraison_extrafields_rowid_seq OWNED BY public.llx_livraison_extrafields.rowid;


--
-- TOC entry 454 (class 1259 OID 835890)
-- Name: llx_livraison_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_livraison_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_livraison_rowid_seq OWNER TO postgres;

--
-- TOC entry 6572 (class 0 OID 0)
-- Dependencies: 454
-- Name: llx_livraison_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_livraison_rowid_seq OWNED BY public.llx_livraison.rowid;


--
-- TOC entry 455 (class 1259 OID 835892)
-- Name: llx_livraisondet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_livraisondet (
    rowid integer NOT NULL,
    fk_livraison integer,
    fk_origin_line integer,
    fk_product integer,
    description text,
    qty real,
    subprice numeric(24,8) DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    rang integer DEFAULT 0
);


ALTER TABLE public.llx_livraisondet OWNER TO postgres;

--
-- TOC entry 456 (class 1259 OID 835901)
-- Name: llx_livraisondet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_livraisondet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_livraisondet_extrafields OWNER TO postgres;

--
-- TOC entry 457 (class 1259 OID 835905)
-- Name: llx_livraisondet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_livraisondet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_livraisondet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6573 (class 0 OID 0)
-- Dependencies: 457
-- Name: llx_livraisondet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_livraisondet_extrafields_rowid_seq OWNED BY public.llx_livraisondet_extrafields.rowid;


--
-- TOC entry 458 (class 1259 OID 835907)
-- Name: llx_livraisondet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_livraisondet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_livraisondet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6574 (class 0 OID 0)
-- Dependencies: 458
-- Name: llx_livraisondet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_livraisondet_rowid_seq OWNED BY public.llx_livraisondet.rowid;


--
-- TOC entry 459 (class 1259 OID 835909)
-- Name: llx_loan; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_loan (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    label character varying(80) NOT NULL,
    fk_bank integer,
    capital real DEFAULT 0 NOT NULL,
    datestart date,
    dateend date,
    nbterm real,
    rate numeric NOT NULL,
    note_private text,
    note_public text,
    capital_position real DEFAULT 0,
    date_position date,
    paid smallint DEFAULT 0 NOT NULL,
    accountancy_account_capital character varying(32),
    accountancy_account_insurance character varying(32),
    accountancy_account_interest character varying(32),
    fk_projet integer,
    fk_user_author integer,
    fk_user_modif integer,
    active smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_loan OWNER TO postgres;

--
-- TOC entry 460 (class 1259 OID 835921)
-- Name: llx_loan_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_loan_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_loan_rowid_seq OWNER TO postgres;

--
-- TOC entry 6575 (class 0 OID 0)
-- Dependencies: 460
-- Name: llx_loan_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_loan_rowid_seq OWNED BY public.llx_loan.rowid;


--
-- TOC entry 461 (class 1259 OID 835923)
-- Name: llx_loan_schedule; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_loan_schedule (
    rowid integer NOT NULL,
    fk_loan integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount_capital real DEFAULT 0,
    amount_insurance real DEFAULT 0,
    amount_interest real DEFAULT 0,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    note_private text,
    note_public text,
    fk_bank integer NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_loan_schedule OWNER TO postgres;

--
-- TOC entry 462 (class 1259 OID 835933)
-- Name: llx_loan_schedule_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_loan_schedule_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_loan_schedule_rowid_seq OWNER TO postgres;

--
-- TOC entry 6576 (class 0 OID 0)
-- Dependencies: 462
-- Name: llx_loan_schedule_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_loan_schedule_rowid_seq OWNED BY public.llx_loan_schedule.rowid;


--
-- TOC entry 463 (class 1259 OID 835935)
-- Name: llx_localtax; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_localtax (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    localtaxtype smallint,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep date,
    datev date,
    amount numeric,
    label character varying(255),
    note text,
    fk_bank integer,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_localtax OWNER TO postgres;

--
-- TOC entry 464 (class 1259 OID 835943)
-- Name: llx_localtax_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_localtax_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_localtax_rowid_seq OWNER TO postgres;

--
-- TOC entry 6577 (class 0 OID 0)
-- Dependencies: 464
-- Name: llx_localtax_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_localtax_rowid_seq OWNED BY public.llx_localtax.rowid;


--
-- TOC entry 465 (class 1259 OID 835945)
-- Name: llx_mailing; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_mailing (
    rowid integer NOT NULL,
    statut smallint DEFAULT 0,
    titre character varying(60),
    entity integer DEFAULT 1 NOT NULL,
    sujet character varying(60),
    body text,
    bgcolor character varying(8),
    bgimage character varying(255),
    cible character varying(60),
    nbemail integer,
    email_from character varying(160),
    email_replyto character varying(160),
    email_errorsto character varying(160),
    tag character varying(128),
    date_creat timestamp without time zone,
    date_valid timestamp without time zone,
    date_appro timestamp without time zone,
    date_envoi timestamp without time zone,
    fk_user_creat integer,
    fk_user_valid integer,
    fk_user_appro integer,
    extraparams character varying(255),
    joined_file1 character varying(255),
    joined_file2 character varying(255),
    joined_file3 character varying(255),
    joined_file4 character varying(255)
);


ALTER TABLE public.llx_mailing OWNER TO postgres;

--
-- TOC entry 466 (class 1259 OID 835953)
-- Name: llx_mailing_cibles; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_mailing_cibles (
    rowid integer NOT NULL,
    fk_mailing integer NOT NULL,
    fk_contact integer NOT NULL,
    lastname character varying(160),
    firstname character varying(160),
    email character varying(160) NOT NULL,
    other character varying(255),
    tag character varying(128),
    statut smallint DEFAULT 0 NOT NULL,
    source_url character varying(255),
    source_id integer,
    source_type character varying(16),
    date_envoi timestamp without time zone,
    error_text character varying(255)
);


ALTER TABLE public.llx_mailing_cibles OWNER TO postgres;

--
-- TOC entry 467 (class 1259 OID 835960)
-- Name: llx_mailing_cibles_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_mailing_cibles_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_mailing_cibles_rowid_seq OWNER TO postgres;

--
-- TOC entry 6578 (class 0 OID 0)
-- Dependencies: 467
-- Name: llx_mailing_cibles_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_mailing_cibles_rowid_seq OWNED BY public.llx_mailing_cibles.rowid;


--
-- TOC entry 468 (class 1259 OID 835962)
-- Name: llx_mailing_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_mailing_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_mailing_rowid_seq OWNER TO postgres;

--
-- TOC entry 6579 (class 0 OID 0)
-- Dependencies: 468
-- Name: llx_mailing_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_mailing_rowid_seq OWNED BY public.llx_mailing.rowid;


--
-- TOC entry 469 (class 1259 OID 835964)
-- Name: llx_menu; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_menu (
    rowid integer NOT NULL,
    menu_handler character varying(16) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    module character varying(64),
    type character varying(4) NOT NULL,
    mainmenu character varying(100) NOT NULL,
    leftmenu character varying(100),
    fk_menu integer NOT NULL,
    fk_mainmenu character varying(24),
    fk_leftmenu character varying(24),
    "position" integer NOT NULL,
    url character varying(255) NOT NULL,
    target character varying(100),
    titre character varying(255) NOT NULL,
    langs character varying(100),
    level smallint,
    perms character varying(255),
    enabled character varying(255) DEFAULT '1'::character varying,
    usertype integer DEFAULT 0 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_menu OWNER TO postgres;

--
-- TOC entry 470 (class 1259 OID 835974)
-- Name: llx_menu_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_menu_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_menu_rowid_seq OWNER TO postgres;

--
-- TOC entry 6580 (class 0 OID 0)
-- Dependencies: 470
-- Name: llx_menu_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_menu_rowid_seq OWNED BY public.llx_menu.rowid;


--
-- TOC entry 471 (class 1259 OID 835976)
-- Name: llx_multicurrency; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_multicurrency (
    rowid integer NOT NULL,
    date_create timestamp without time zone,
    code character varying(255) DEFAULT NULL::character varying,
    name character varying(255) DEFAULT NULL::character varying,
    entity integer DEFAULT 1,
    fk_user integer
);


ALTER TABLE public.llx_multicurrency OWNER TO postgres;

--
-- TOC entry 472 (class 1259 OID 835985)
-- Name: llx_multicurrency_rate; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_multicurrency_rate (
    rowid integer NOT NULL,
    date_sync timestamp without time zone,
    rate numeric DEFAULT 0 NOT NULL,
    fk_multicurrency integer NOT NULL,
    entity integer DEFAULT 1
);


ALTER TABLE public.llx_multicurrency_rate OWNER TO postgres;

--
-- TOC entry 473 (class 1259 OID 835993)
-- Name: llx_multicurrency_rate_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_multicurrency_rate_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_multicurrency_rate_rowid_seq OWNER TO postgres;

--
-- TOC entry 6581 (class 0 OID 0)
-- Dependencies: 473
-- Name: llx_multicurrency_rate_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_multicurrency_rate_rowid_seq OWNED BY public.llx_multicurrency_rate.rowid;


--
-- TOC entry 474 (class 1259 OID 835995)
-- Name: llx_multicurrency_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_multicurrency_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_multicurrency_rowid_seq OWNER TO postgres;

--
-- TOC entry 6582 (class 0 OID 0)
-- Dependencies: 474
-- Name: llx_multicurrency_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_multicurrency_rowid_seq OWNED BY public.llx_multicurrency.rowid;


--
-- TOC entry 475 (class 1259 OID 835997)
-- Name: llx_notify; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_notify (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    daten timestamp without time zone,
    fk_action integer NOT NULL,
    fk_soc integer,
    fk_contact integer,
    fk_user integer,
    type character varying(16) DEFAULT 'email'::character varying,
    type_target character varying(16),
    objet_type character varying(24) NOT NULL,
    objet_id integer NOT NULL,
    email character varying(255)
);


ALTER TABLE public.llx_notify OWNER TO postgres;

--
-- TOC entry 476 (class 1259 OID 836002)
-- Name: llx_notify_def; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_notify_def (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec date,
    fk_action integer NOT NULL,
    fk_soc integer,
    fk_contact integer,
    fk_user integer,
    type character varying(16) DEFAULT 'email'::character varying
);


ALTER TABLE public.llx_notify_def OWNER TO postgres;

--
-- TOC entry 477 (class 1259 OID 836007)
-- Name: llx_notify_def_object; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_notify_def_object (
    id integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    objet_type character varying(16),
    objet_id integer NOT NULL,
    type_notif character varying(16) DEFAULT 'browser'::character varying,
    date_notif timestamp without time zone,
    user_id integer,
    moreparam character varying(255)
);


ALTER TABLE public.llx_notify_def_object OWNER TO postgres;

--
-- TOC entry 478 (class 1259 OID 836012)
-- Name: llx_notify_def_object_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_notify_def_object_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_notify_def_object_id_seq OWNER TO postgres;

--
-- TOC entry 6583 (class 0 OID 0)
-- Dependencies: 478
-- Name: llx_notify_def_object_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_notify_def_object_id_seq OWNED BY public.llx_notify_def_object.id;


--
-- TOC entry 479 (class 1259 OID 836014)
-- Name: llx_notify_def_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_notify_def_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_notify_def_rowid_seq OWNER TO postgres;

--
-- TOC entry 6584 (class 0 OID 0)
-- Dependencies: 479
-- Name: llx_notify_def_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_notify_def_rowid_seq OWNED BY public.llx_notify_def.rowid;


--
-- TOC entry 480 (class 1259 OID 836016)
-- Name: llx_notify_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_notify_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_notify_rowid_seq OWNER TO postgres;

--
-- TOC entry 6585 (class 0 OID 0)
-- Dependencies: 480
-- Name: llx_notify_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_notify_rowid_seq OWNED BY public.llx_notify.rowid;


--
-- TOC entry 481 (class 1259 OID 836018)
-- Name: llx_oauth_state; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_oauth_state (
    rowid integer NOT NULL,
    service character varying(36),
    state character varying(128),
    fk_user integer,
    fk_adherent integer,
    entity integer DEFAULT 1
);


ALTER TABLE public.llx_oauth_state OWNER TO postgres;

--
-- TOC entry 482 (class 1259 OID 836022)
-- Name: llx_oauth_state_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_oauth_state_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_oauth_state_rowid_seq OWNER TO postgres;

--
-- TOC entry 6586 (class 0 OID 0)
-- Dependencies: 482
-- Name: llx_oauth_state_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_oauth_state_rowid_seq OWNED BY public.llx_oauth_state.rowid;

--
-- TOC entry 484 (class 1259 OID 836031)
-- Name: llx_oauth_token_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_oauth_token_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_oauth_token_rowid_seq OWNER TO postgres;

--
-- TOC entry 6587 (class 0 OID 0)
-- Dependencies: 484
-- Name: llx_oauth_token_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_oauth_token_rowid_seq OWNED BY public.llx_oauth_token.rowid;


--
-- TOC entry 485 (class 1259 OID 836033)
-- Name: llx_opensurvey_comments; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_opensurvey_comments (
    id_comment integer NOT NULL,
    id_sondage character(16) NOT NULL,
    comment text NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    usercomment text
);


ALTER TABLE public.llx_opensurvey_comments OWNER TO postgres;

--
-- TOC entry 486 (class 1259 OID 836040)
-- Name: llx_opensurvey_comments_id_comment_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_opensurvey_comments_id_comment_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_opensurvey_comments_id_comment_seq OWNER TO postgres;

--
-- TOC entry 6588 (class 0 OID 0)
-- Dependencies: 486
-- Name: llx_opensurvey_comments_id_comment_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_opensurvey_comments_id_comment_seq OWNED BY public.llx_opensurvey_comments.id_comment;


--
-- TOC entry 487 (class 1259 OID 836042)
-- Name: llx_opensurvey_formquestions; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_opensurvey_formquestions (
    rowid integer NOT NULL,
    id_sondage character varying(16),
    question text,
    available_answers text
);


ALTER TABLE public.llx_opensurvey_formquestions OWNER TO postgres;

--
-- TOC entry 488 (class 1259 OID 836048)
-- Name: llx_opensurvey_formquestions_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_opensurvey_formquestions_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_opensurvey_formquestions_rowid_seq OWNER TO postgres;

--
-- TOC entry 6589 (class 0 OID 0)
-- Dependencies: 488
-- Name: llx_opensurvey_formquestions_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_opensurvey_formquestions_rowid_seq OWNED BY public.llx_opensurvey_formquestions.rowid;


--
-- TOC entry 489 (class 1259 OID 836050)
-- Name: llx_opensurvey_sondage; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_opensurvey_sondage (
    id_sondage character varying(16) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    commentaires text,
    mail_admin character varying(128),
    nom_admin character varying(64),
    fk_user_creat integer NOT NULL,
    titre text NOT NULL,
    date_fin timestamp without time zone,
    status integer DEFAULT 1,
    format character varying(2) NOT NULL,
    mailsonde smallint DEFAULT 0 NOT NULL,
    allow_comments smallint DEFAULT 1 NOT NULL,
    allow_spy smallint DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    sujet text
);


ALTER TABLE public.llx_opensurvey_sondage OWNER TO postgres;

--
-- TOC entry 490 (class 1259 OID 836062)
-- Name: llx_opensurvey_user_formanswers; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_opensurvey_user_formanswers (
    fk_user_survey integer NOT NULL,
    fk_question integer NOT NULL,
    reponses text
);


ALTER TABLE public.llx_opensurvey_user_formanswers OWNER TO postgres;

--
-- TOC entry 491 (class 1259 OID 836068)
-- Name: llx_opensurvey_user_studs; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_opensurvey_user_studs (
    id_users integer NOT NULL,
    nom character varying(64) NOT NULL,
    id_sondage character varying(16) NOT NULL,
    reponses character varying(100) NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.llx_opensurvey_user_studs OWNER TO postgres;

--
-- TOC entry 492 (class 1259 OID 836072)
-- Name: llx_opensurvey_user_studs_id_users_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_opensurvey_user_studs_id_users_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_opensurvey_user_studs_id_users_seq OWNER TO postgres;

--
-- TOC entry 6590 (class 0 OID 0)
-- Dependencies: 492
-- Name: llx_opensurvey_user_studs_id_users_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_opensurvey_user_studs_id_users_seq OWNED BY public.llx_opensurvey_user_studs.id_users;


--
-- TOC entry 493 (class 1259 OID 836074)
-- Name: llx_overwrite_trans; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_overwrite_trans (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    lang character varying(5),
    transkey character varying(128),
    transvalue text
);


ALTER TABLE public.llx_overwrite_trans OWNER TO postgres;

--
-- TOC entry 494 (class 1259 OID 836081)
-- Name: llx_overwrite_trans_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_overwrite_trans_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_overwrite_trans_rowid_seq OWNER TO postgres;

--
-- TOC entry 6591 (class 0 OID 0)
-- Dependencies: 494
-- Name: llx_overwrite_trans_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_overwrite_trans_rowid_seq OWNED BY public.llx_overwrite_trans.rowid;


--
-- TOC entry 495 (class 1259 OID 836083)
-- Name: llx_paiement; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_paiement (
    rowid integer NOT NULL,
    ref character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount numeric(24,8) DEFAULT 0,
    multicurrency_amount numeric(24,8) DEFAULT 0,
    fk_paiement integer NOT NULL,
    num_paiement character varying(50),
    note text,
    fk_bank integer DEFAULT 0 NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer,
    statut smallint DEFAULT 0 NOT NULL,
    fk_export_compta integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.llx_paiement OWNER TO postgres;

--
-- TOC entry 496 (class 1259 OID 836096)
-- Name: llx_paiement_facture; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_paiement_facture (
    rowid integer NOT NULL,
    fk_paiement integer,
    fk_facture integer,
    amount numeric(24,8) DEFAULT 0,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_amount numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_paiement_facture OWNER TO postgres;

--
-- TOC entry 497 (class 1259 OID 836102)
-- Name: llx_paiement_facture_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_paiement_facture_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_paiement_facture_rowid_seq OWNER TO postgres;

--
-- TOC entry 6592 (class 0 OID 0)
-- Dependencies: 497
-- Name: llx_paiement_facture_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_paiement_facture_rowid_seq OWNED BY public.llx_paiement_facture.rowid;


--
-- TOC entry 498 (class 1259 OID 836104)
-- Name: llx_paiement_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_paiement_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_paiement_rowid_seq OWNER TO postgres;

--
-- TOC entry 6593 (class 0 OID 0)
-- Dependencies: 498
-- Name: llx_paiement_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_paiement_rowid_seq OWNED BY public.llx_paiement.rowid;


--
-- TOC entry 499 (class 1259 OID 836106)
-- Name: llx_paiementcharge; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_paiementcharge (
    rowid integer NOT NULL,
    fk_charge integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount real DEFAULT 0,
    fk_typepaiement integer NOT NULL,
    num_paiement character varying(50),
    note text,
    fk_bank integer NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_paiementcharge OWNER TO postgres;

--
-- TOC entry 500 (class 1259 OID 836114)
-- Name: llx_paiementcharge_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_paiementcharge_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_paiementcharge_rowid_seq OWNER TO postgres;

--
-- TOC entry 6594 (class 0 OID 0)
-- Dependencies: 500
-- Name: llx_paiementcharge_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_paiementcharge_rowid_seq OWNED BY public.llx_paiementcharge.rowid;


--
-- TOC entry 501 (class 1259 OID 836116)
-- Name: llx_paiementfourn; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_paiementfourn (
    rowid integer NOT NULL,
    ref character varying(30),
    entity integer DEFAULT 1,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    datep timestamp without time zone,
    amount real DEFAULT 0,
    multicurrency_amount numeric(24,8) DEFAULT 0,
    fk_user_author integer,
    fk_paiement integer NOT NULL,
    num_paiement character varying(50),
    note text,
    fk_bank integer NOT NULL,
    statut smallint DEFAULT 0 NOT NULL,
    model_pdf character varying(255)
);


ALTER TABLE public.llx_paiementfourn OWNER TO postgres;

--
-- TOC entry 502 (class 1259 OID 836127)
-- Name: llx_paiementfourn_facturefourn; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_paiementfourn_facturefourn (
    rowid integer NOT NULL,
    fk_paiementfourn integer,
    fk_facturefourn integer,
    amount numeric(24,8) DEFAULT 0,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_amount numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_paiementfourn_facturefourn OWNER TO postgres;

--
-- TOC entry 503 (class 1259 OID 836133)
-- Name: llx_paiementfourn_facturefourn_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_paiementfourn_facturefourn_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_paiementfourn_facturefourn_rowid_seq OWNER TO postgres;

--
-- TOC entry 6595 (class 0 OID 0)
-- Dependencies: 503
-- Name: llx_paiementfourn_facturefourn_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_paiementfourn_facturefourn_rowid_seq OWNED BY public.llx_paiementfourn_facturefourn.rowid;


--
-- TOC entry 504 (class 1259 OID 836135)
-- Name: llx_paiementfourn_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_paiementfourn_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_paiementfourn_rowid_seq OWNER TO postgres;

--
-- TOC entry 6596 (class 0 OID 0)
-- Dependencies: 504
-- Name: llx_paiementfourn_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_paiementfourn_rowid_seq OWNED BY public.llx_paiementfourn.rowid;


--
-- TOC entry 505 (class 1259 OID 836137)
-- Name: llx_payment_donation; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_payment_donation (
    rowid integer NOT NULL,
    fk_donation integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount real DEFAULT 0,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    note text,
    fk_bank integer NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_payment_donation OWNER TO postgres;

--
-- TOC entry 506 (class 1259 OID 836145)
-- Name: llx_payment_donation_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_payment_donation_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_payment_donation_rowid_seq OWNER TO postgres;

--
-- TOC entry 6597 (class 0 OID 0)
-- Dependencies: 506
-- Name: llx_payment_donation_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_payment_donation_rowid_seq OWNED BY public.llx_payment_donation.rowid;


--
-- TOC entry 507 (class 1259 OID 836147)
-- Name: llx_payment_expensereport; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_payment_expensereport (
    rowid integer NOT NULL,
    fk_expensereport integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount real DEFAULT 0,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    note text,
    fk_bank integer NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_payment_expensereport OWNER TO postgres;

--
-- TOC entry 508 (class 1259 OID 836155)
-- Name: llx_payment_expensereport_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_payment_expensereport_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_payment_expensereport_rowid_seq OWNER TO postgres;

--
-- TOC entry 6598 (class 0 OID 0)
-- Dependencies: 508
-- Name: llx_payment_expensereport_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_payment_expensereport_rowid_seq OWNED BY public.llx_payment_expensereport.rowid;


--
-- TOC entry 509 (class 1259 OID 836157)
-- Name: llx_payment_loan; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_payment_loan (
    rowid integer NOT NULL,
    fk_loan integer,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datep timestamp without time zone,
    amount_capital real DEFAULT 0,
    amount_insurance real DEFAULT 0,
    amount_interest real DEFAULT 0,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    note_private text,
    note_public text,
    fk_bank integer NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_payment_loan OWNER TO postgres;

--
-- TOC entry 510 (class 1259 OID 836167)
-- Name: llx_payment_loan_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_payment_loan_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_payment_loan_rowid_seq OWNER TO postgres;

--
-- TOC entry 6599 (class 0 OID 0)
-- Dependencies: 510
-- Name: llx_payment_loan_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_payment_loan_rowid_seq OWNED BY public.llx_payment_loan.rowid;


--
-- TOC entry 511 (class 1259 OID 836169)
-- Name: llx_payment_salary; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_payment_salary (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    fk_user integer NOT NULL,
    datep date,
    datev date,
    salary real,
    amount real DEFAULT 0 NOT NULL,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    label character varying(255),
    datesp date,
    dateep date,
    entity integer DEFAULT 1 NOT NULL,
    note text,
    fk_bank integer,
    fk_user_author integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_payment_salary OWNER TO postgres;

--
-- TOC entry 512 (class 1259 OID 836178)
-- Name: llx_payment_salary_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_payment_salary_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_payment_salary_rowid_seq OWNER TO postgres;

--
-- TOC entry 6600 (class 0 OID 0)
-- Dependencies: 512
-- Name: llx_payment_salary_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_payment_salary_rowid_seq OWNED BY public.llx_payment_salary.rowid;


--
-- TOC entry 513 (class 1259 OID 836180)
-- Name: llx_payment_various; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_payment_various (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    datep date,
    datev date,
    sens smallint DEFAULT 0 NOT NULL,
    amount numeric(24,8) DEFAULT 0 NOT NULL,
    fk_typepayment integer NOT NULL,
    num_payment character varying(50),
    label character varying(255),
    accountancy_code character varying(32),
    entity integer DEFAULT 1 NOT NULL,
    note text,
    fk_bank integer,
    fk_user_author integer,
    fk_user_modif integer
);


ALTER TABLE public.llx_payment_various OWNER TO postgres;

--
-- TOC entry 514 (class 1259 OID 836190)
-- Name: llx_payment_various_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_payment_various_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_payment_various_rowid_seq OWNER TO postgres;

--
-- TOC entry 6601 (class 0 OID 0)
-- Dependencies: 514
-- Name: llx_payment_various_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_payment_various_rowid_seq OWNED BY public.llx_payment_various.rowid;


--
-- TOC entry 515 (class 1259 OID 836192)
-- Name: llx_prelevement_bons; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_prelevement_bons (
    rowid integer NOT NULL,
    ref character varying(12),
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    amount real DEFAULT 0,
    statut smallint DEFAULT 0,
    credite smallint DEFAULT 0,
    note text,
    date_trans timestamp without time zone,
    method_trans smallint,
    fk_user_trans integer,
    date_credit timestamp without time zone,
    fk_user_credit integer
);


ALTER TABLE public.llx_prelevement_bons OWNER TO postgres;

--
-- TOC entry 516 (class 1259 OID 836202)
-- Name: llx_prelevement_bons_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_prelevement_bons_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_prelevement_bons_rowid_seq OWNER TO postgres;

--
-- TOC entry 6602 (class 0 OID 0)
-- Dependencies: 516
-- Name: llx_prelevement_bons_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_prelevement_bons_rowid_seq OWNED BY public.llx_prelevement_bons.rowid;


--
-- TOC entry 517 (class 1259 OID 836204)
-- Name: llx_prelevement_facture; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_prelevement_facture (
    rowid integer NOT NULL,
    fk_facture integer NOT NULL,
    fk_prelevement_lignes integer NOT NULL
);


ALTER TABLE public.llx_prelevement_facture OWNER TO postgres;

--
-- TOC entry 518 (class 1259 OID 836207)
-- Name: llx_prelevement_facture_demande; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_prelevement_facture_demande (
    rowid integer NOT NULL,
    fk_facture integer NOT NULL,
    amount real NOT NULL,
    date_demande timestamp without time zone,
    traite smallint DEFAULT 0,
    date_traite timestamp without time zone,
    fk_prelevement_bons integer,
    fk_user_demande integer NOT NULL,
    code_banque character varying(128),
    code_guichet character varying(6),
    number character varying(255),
    cle_rib character varying(5)
);


ALTER TABLE public.llx_prelevement_facture_demande OWNER TO postgres;

--
-- TOC entry 519 (class 1259 OID 836211)
-- Name: llx_prelevement_facture_demande_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_prelevement_facture_demande_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_prelevement_facture_demande_rowid_seq OWNER TO postgres;

--
-- TOC entry 6603 (class 0 OID 0)
-- Dependencies: 519
-- Name: llx_prelevement_facture_demande_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_prelevement_facture_demande_rowid_seq OWNED BY public.llx_prelevement_facture_demande.rowid;


--
-- TOC entry 520 (class 1259 OID 836213)
-- Name: llx_prelevement_facture_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_prelevement_facture_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_prelevement_facture_rowid_seq OWNER TO postgres;

--
-- TOC entry 6604 (class 0 OID 0)
-- Dependencies: 520
-- Name: llx_prelevement_facture_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_prelevement_facture_rowid_seq OWNED BY public.llx_prelevement_facture.rowid;


--
-- TOC entry 521 (class 1259 OID 836215)
-- Name: llx_prelevement_lignes; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_prelevement_lignes (
    rowid integer NOT NULL,
    fk_prelevement_bons integer,
    fk_soc integer NOT NULL,
    statut smallint DEFAULT 0,
    client_nom character varying(255),
    amount real DEFAULT 0,
    code_banque character varying(128),
    code_guichet character varying(6),
    number character varying(255),
    cle_rib character varying(5),
    note text
);


ALTER TABLE public.llx_prelevement_lignes OWNER TO postgres;

--
-- TOC entry 522 (class 1259 OID 836223)
-- Name: llx_prelevement_lignes_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_prelevement_lignes_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_prelevement_lignes_rowid_seq OWNER TO postgres;

--
-- TOC entry 6605 (class 0 OID 0)
-- Dependencies: 522
-- Name: llx_prelevement_lignes_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_prelevement_lignes_rowid_seq OWNED BY public.llx_prelevement_lignes.rowid;


--
-- TOC entry 523 (class 1259 OID 836225)
-- Name: llx_prelevement_rejet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_prelevement_rejet (
    rowid integer NOT NULL,
    fk_prelevement_lignes integer,
    date_rejet timestamp without time zone,
    motif integer,
    date_creation timestamp without time zone,
    fk_user_creation integer,
    note text,
    afacturer smallint DEFAULT 0,
    fk_facture integer
);


ALTER TABLE public.llx_prelevement_rejet OWNER TO postgres;

--
-- TOC entry 524 (class 1259 OID 836232)
-- Name: llx_prelevement_rejet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_prelevement_rejet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_prelevement_rejet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6606 (class 0 OID 0)
-- Dependencies: 524
-- Name: llx_prelevement_rejet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_prelevement_rejet_rowid_seq OWNED BY public.llx_prelevement_rejet.rowid;


--
-- TOC entry 525 (class 1259 OID 836234)
-- Name: llx_printing; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_printing (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    printer_name text NOT NULL,
    printer_location text NOT NULL,
    printer_id character varying(255) NOT NULL,
    copy integer DEFAULT 1 NOT NULL,
    module character varying(16) NOT NULL,
    driver character varying(16) NOT NULL,
    userid integer
);


ALTER TABLE public.llx_printing OWNER TO postgres;

--
-- TOC entry 526 (class 1259 OID 836242)
-- Name: llx_printing_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_printing_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_printing_rowid_seq OWNER TO postgres;

--
-- TOC entry 6607 (class 0 OID 0)
-- Dependencies: 526
-- Name: llx_printing_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_printing_rowid_seq OWNED BY public.llx_printing.rowid;


--
-- TOC entry 527 (class 1259 OID 836244)
-- Name: llx_product; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product (
    rowid integer NOT NULL,
    ref character varying(128) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(128),
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_parent integer DEFAULT 0,
    label character varying(255) NOT NULL,
    description text,
    note_public text,
    note text,
    customcode character varying(32),
    fk_country integer,
    price numeric(24,8) DEFAULT 0,
    price_ttc numeric(24,8) DEFAULT 0,
    price_min numeric(24,8) DEFAULT 0,
    price_min_ttc numeric(24,8) DEFAULT 0,
    price_base_type character varying(3) DEFAULT 'HT'::character varying,
    cost_price numeric(24,8) DEFAULT NULL::numeric,
    default_vat_code character varying(10),
    tva_tx numeric(6,3),
    recuperableonly integer DEFAULT 0 NOT NULL,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    fk_user_author integer,
    fk_user_modif integer,
    tosell smallint DEFAULT 1,
    tobuy smallint DEFAULT 1,
    onportal smallint DEFAULT 0,
    tobatch smallint DEFAULT 0 NOT NULL,
    fk_product_type integer DEFAULT 0,
    duration character varying(6),
    seuil_stock_alerte integer DEFAULT 0,
    url character varying(255),
    barcode character varying(255) DEFAULT NULL::character varying,
    fk_barcode_type integer,
    accountancy_code_sell character varying(32),
    accountancy_code_buy character varying(32),
    partnumber character varying(32),
    weight numeric,
    weight_units smallint,
    length numeric,
    length_units smallint,
    width numeric,
    width_units smallint,
    height numeric,
    height_units smallint,
    surface numeric,
    surface_units smallint,
    volume numeric,
    volume_units smallint,
    stock real,
    pmp numeric(24,8) DEFAULT 0 NOT NULL,
    fifo numeric(24,8),
    lifo numeric(24,8),
    canvas character varying(32) DEFAULT NULL::character varying,
    finished smallint,
    hidden smallint DEFAULT 0,
    import_key character varying(14),
    model_pdf character varying(255),
    fk_price_expression integer,
    desiredstock integer DEFAULT 0,
    fk_unit integer,
    price_autogen smallint DEFAULT 0
);


ALTER TABLE public.llx_product OWNER TO postgres;

--
-- TOC entry 528 (class 1259 OID 836276)
-- Name: llx_product_association; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_association (
    rowid integer NOT NULL,
    fk_product_pere integer DEFAULT 0 NOT NULL,
    fk_product_fils integer DEFAULT 0 NOT NULL,
    qty numeric,
    incdec integer DEFAULT 1
);


ALTER TABLE public.llx_product_association OWNER TO postgres;

--
-- TOC entry 529 (class 1259 OID 836285)
-- Name: llx_product_association_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_association_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_association_rowid_seq OWNER TO postgres;

--
-- TOC entry 6608 (class 0 OID 0)
-- Dependencies: 529
-- Name: llx_product_association_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_association_rowid_seq OWNED BY public.llx_product_association.rowid;


--
-- TOC entry 530 (class 1259 OID 836287)
-- Name: llx_product_attribute; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_attribute (
    rowid integer NOT NULL,
    ref character varying(255) NOT NULL,
    label character varying(255) NOT NULL,
    rang integer DEFAULT 0 NOT NULL,
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_product_attribute OWNER TO postgres;

--
-- TOC entry 531 (class 1259 OID 836295)
-- Name: llx_product_attribute_combination; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_attribute_combination (
    rowid integer NOT NULL,
    fk_product_parent integer NOT NULL,
    fk_product_child integer NOT NULL,
    variation_price numeric NOT NULL,
    variation_price_percentage integer,
    variation_weight numeric NOT NULL,
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_product_attribute_combination OWNER TO postgres;

--
-- TOC entry 532 (class 1259 OID 836302)
-- Name: llx_product_attribute_combination2val; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_attribute_combination2val (
    rowid integer NOT NULL,
    fk_prod_combination integer NOT NULL,
    fk_prod_attr integer NOT NULL,
    fk_prod_attr_val integer NOT NULL
);


ALTER TABLE public.llx_product_attribute_combination2val OWNER TO postgres;

--
-- TOC entry 533 (class 1259 OID 836305)
-- Name: llx_product_attribute_combination2val_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_attribute_combination2val_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_attribute_combination2val_rowid_seq OWNER TO postgres;

--
-- TOC entry 6609 (class 0 OID 0)
-- Dependencies: 533
-- Name: llx_product_attribute_combination2val_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_attribute_combination2val_rowid_seq OWNED BY public.llx_product_attribute_combination2val.rowid;


--
-- TOC entry 534 (class 1259 OID 836307)
-- Name: llx_product_attribute_combination_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_attribute_combination_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_attribute_combination_rowid_seq OWNER TO postgres;

--
-- TOC entry 6610 (class 0 OID 0)
-- Dependencies: 534
-- Name: llx_product_attribute_combination_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_attribute_combination_rowid_seq OWNED BY public.llx_product_attribute_combination.rowid;


--
-- TOC entry 535 (class 1259 OID 836309)
-- Name: llx_product_attribute_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_attribute_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_attribute_rowid_seq OWNER TO postgres;

--
-- TOC entry 6611 (class 0 OID 0)
-- Dependencies: 535
-- Name: llx_product_attribute_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_attribute_rowid_seq OWNED BY public.llx_product_attribute.rowid;


--
-- TOC entry 536 (class 1259 OID 836311)
-- Name: llx_product_attribute_value; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_attribute_value (
    rowid integer NOT NULL,
    fk_product_attribute integer NOT NULL,
    ref character varying(255) DEFAULT NULL::character varying,
    value character varying(255) DEFAULT NULL::character varying,
    entity integer DEFAULT 1 NOT NULL
);


ALTER TABLE public.llx_product_attribute_value OWNER TO postgres;

--
-- TOC entry 537 (class 1259 OID 836320)
-- Name: llx_product_attribute_value_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_attribute_value_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_attribute_value_rowid_seq OWNER TO postgres;

--
-- TOC entry 6612 (class 0 OID 0)
-- Dependencies: 537
-- Name: llx_product_attribute_value_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_attribute_value_rowid_seq OWNED BY public.llx_product_attribute_value.rowid;


--
-- TOC entry 538 (class 1259 OID 836322)
-- Name: llx_product_batch; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_batch (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product_stock integer NOT NULL,
    eatby timestamp without time zone,
    sellby timestamp without time zone,
    batch character varying(30) NOT NULL,
    qty numeric DEFAULT 0 NOT NULL,
    import_key character varying(14) DEFAULT NULL::character varying
);


ALTER TABLE public.llx_product_batch OWNER TO postgres;

--
-- TOC entry 539 (class 1259 OID 836331)
-- Name: llx_product_batch_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_batch_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_batch_rowid_seq OWNER TO postgres;

--
-- TOC entry 6613 (class 0 OID 0)
-- Dependencies: 539
-- Name: llx_product_batch_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_batch_rowid_seq OWNED BY public.llx_product_batch.rowid;


--
-- TOC entry 540 (class 1259 OID 836333)
-- Name: llx_product_customer_price; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_customer_price (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product integer NOT NULL,
    fk_soc integer NOT NULL,
    price numeric(24,8) DEFAULT 0,
    price_ttc numeric(24,8) DEFAULT 0,
    price_min numeric(24,8) DEFAULT 0,
    price_min_ttc numeric(24,8) DEFAULT 0,
    price_base_type character varying(3) DEFAULT 'HT'::character varying,
    default_vat_code character varying(10),
    tva_tx numeric(6,3),
    recuperableonly integer DEFAULT 0 NOT NULL,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    fk_user integer,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_customer_price OWNER TO postgres;

--
-- TOC entry 541 (class 1259 OID 836348)
-- Name: llx_product_customer_price_log; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_customer_price_log (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    fk_product integer NOT NULL,
    fk_soc integer NOT NULL,
    price numeric(24,8) DEFAULT 0,
    price_ttc numeric(24,8) DEFAULT 0,
    price_min numeric(24,8) DEFAULT 0,
    price_min_ttc numeric(24,8) DEFAULT 0,
    price_base_type character varying(3) DEFAULT 'HT'::character varying,
    default_vat_code character varying(10),
    tva_tx numeric(6,3),
    recuperableonly integer DEFAULT 0 NOT NULL,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    fk_user integer,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_customer_price_log OWNER TO postgres;

--
-- TOC entry 542 (class 1259 OID 836362)
-- Name: llx_product_customer_price_log_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_customer_price_log_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_customer_price_log_rowid_seq OWNER TO postgres;

--
-- TOC entry 6614 (class 0 OID 0)
-- Dependencies: 542
-- Name: llx_product_customer_price_log_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_customer_price_log_rowid_seq OWNED BY public.llx_product_customer_price_log.rowid;


--
-- TOC entry 543 (class 1259 OID 836364)
-- Name: llx_product_customer_price_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_customer_price_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_customer_price_rowid_seq OWNER TO postgres;

--
-- TOC entry 6615 (class 0 OID 0)
-- Dependencies: 543
-- Name: llx_product_customer_price_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_customer_price_rowid_seq OWNED BY public.llx_product_customer_price.rowid;


--
-- TOC entry 544 (class 1259 OID 836366)
-- Name: llx_product_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_extrafields OWNER TO postgres;

--
-- TOC entry 545 (class 1259 OID 836370)
-- Name: llx_product_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6616 (class 0 OID 0)
-- Dependencies: 545
-- Name: llx_product_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_extrafields_rowid_seq OWNED BY public.llx_product_extrafields.rowid;


--
-- TOC entry 546 (class 1259 OID 836372)
-- Name: llx_product_fournisseur_price; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_fournisseur_price (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product integer,
    fk_soc integer,
    ref_fourn character varying(30),
    fk_availability integer,
    price numeric(24,8) DEFAULT 0,
    quantity numeric,
    remise_percent numeric DEFAULT 0 NOT NULL,
    remise numeric DEFAULT 0 NOT NULL,
    unitprice numeric(24,8) DEFAULT 0,
    charges numeric(24,8) DEFAULT 0,
    unitcharges numeric(24,8) DEFAULT 0,
    default_vat_code character varying(10),
    tva_tx numeric(6,3) NOT NULL,
    info_bits integer DEFAULT 0 NOT NULL,
    fk_user integer,
    fk_supplier_price_expression integer,
    import_key character varying(14),
    delivery_time_days integer,
    supplier_reputation character varying(10),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_price numeric(24,8) DEFAULT NULL::numeric,
    multicurrency_price_ttc numeric(24,8) DEFAULT NULL::numeric
);


ALTER TABLE public.llx_product_fournisseur_price OWNER TO postgres;

--
-- TOC entry 547 (class 1259 OID 836390)
-- Name: llx_product_fournisseur_price_log; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_fournisseur_price_log (
    rowid integer NOT NULL,
    datec timestamp without time zone,
    fk_product_fournisseur integer NOT NULL,
    price numeric(24,8) DEFAULT 0,
    quantity numeric,
    fk_user integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_price numeric(24,8) DEFAULT NULL::numeric,
    multicurrency_price_ttc numeric(24,8) DEFAULT NULL::numeric
);


ALTER TABLE public.llx_product_fournisseur_price_log OWNER TO postgres;

--
-- TOC entry 548 (class 1259 OID 836400)
-- Name: llx_product_fournisseur_price_log_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_fournisseur_price_log_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_fournisseur_price_log_rowid_seq OWNER TO postgres;

--
-- TOC entry 6617 (class 0 OID 0)
-- Dependencies: 548
-- Name: llx_product_fournisseur_price_log_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_fournisseur_price_log_rowid_seq OWNED BY public.llx_product_fournisseur_price_log.rowid;


--
-- TOC entry 549 (class 1259 OID 836402)
-- Name: llx_product_fournisseur_price_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_fournisseur_price_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_fournisseur_price_rowid_seq OWNER TO postgres;

--
-- TOC entry 6618 (class 0 OID 0)
-- Dependencies: 549
-- Name: llx_product_fournisseur_price_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_fournisseur_price_rowid_seq OWNED BY public.llx_product_fournisseur_price.rowid;


--
-- TOC entry 550 (class 1259 OID 836404)
-- Name: llx_product_lang; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_lang (
    rowid integer NOT NULL,
    fk_product integer DEFAULT 0 NOT NULL,
    lang character varying(5) DEFAULT 0 NOT NULL,
    label character varying(255) NOT NULL,
    description text,
    note text,
    import_key character varying(14) DEFAULT NULL::character varying
);


ALTER TABLE public.llx_product_lang OWNER TO postgres;

--
-- TOC entry 551 (class 1259 OID 836413)
-- Name: llx_product_lang_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_lang_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_lang_rowid_seq OWNER TO postgres;

--
-- TOC entry 6619 (class 0 OID 0)
-- Dependencies: 551
-- Name: llx_product_lang_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_lang_rowid_seq OWNED BY public.llx_product_lang.rowid;


--
-- TOC entry 552 (class 1259 OID 836415)
-- Name: llx_product_lot; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_lot (
    rowid integer NOT NULL,
    entity integer DEFAULT 1,
    fk_product integer NOT NULL,
    batch character varying(30) DEFAULT NULL::character varying,
    eatby date,
    sellby date,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_user_creat integer,
    fk_user_modif integer,
    import_key integer
);


ALTER TABLE public.llx_product_lot OWNER TO postgres;

--
-- TOC entry 553 (class 1259 OID 836421)
-- Name: llx_product_lot_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_lot_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_lot_extrafields OWNER TO postgres;

--
-- TOC entry 554 (class 1259 OID 836425)
-- Name: llx_product_lot_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_lot_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_lot_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6620 (class 0 OID 0)
-- Dependencies: 554
-- Name: llx_product_lot_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_lot_extrafields_rowid_seq OWNED BY public.llx_product_lot_extrafields.rowid;


--
-- TOC entry 555 (class 1259 OID 836427)
-- Name: llx_product_lot_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_lot_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_lot_rowid_seq OWNER TO postgres;

--
-- TOC entry 6621 (class 0 OID 0)
-- Dependencies: 555
-- Name: llx_product_lot_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_lot_rowid_seq OWNED BY public.llx_product_lot.rowid;


--
-- TOC entry 556 (class 1259 OID 836429)
-- Name: llx_product_price; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_price (
    rowid integer NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product integer NOT NULL,
    date_price timestamp without time zone,
    price_level smallint DEFAULT 1,
    price numeric(24,8) DEFAULT NULL::numeric,
    price_ttc numeric(24,8) DEFAULT NULL::numeric,
    price_min numeric(24,8) DEFAULT NULL::numeric,
    price_min_ttc numeric(24,8) DEFAULT NULL::numeric,
    price_base_type character varying(3) DEFAULT 'HT'::character varying,
    default_vat_code character varying(10),
    tva_tx numeric(6,3) NOT NULL,
    recuperableonly integer DEFAULT 0 NOT NULL,
    localtax1_tx numeric(6,3) DEFAULT 0,
    localtax1_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    localtax2_tx numeric(6,3) DEFAULT 0,
    localtax2_type character varying(10) DEFAULT '0'::character varying NOT NULL,
    fk_user_author integer,
    tosell smallint DEFAULT 1,
    price_by_qty integer DEFAULT 0 NOT NULL,
    fk_price_expression integer,
    import_key character varying(14),
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_price numeric(24,8) DEFAULT NULL::numeric,
    multicurrency_price_ttc numeric(24,8) DEFAULT NULL::numeric
);


ALTER TABLE public.llx_product_price OWNER TO postgres;

--
-- TOC entry 557 (class 1259 OID 836450)
-- Name: llx_product_price_by_qty; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_price_by_qty (
    rowid integer NOT NULL,
    fk_product_price integer NOT NULL,
    price numeric(24,8) DEFAULT 0,
    quantity numeric,
    remise_percent numeric DEFAULT 0 NOT NULL,
    remise numeric DEFAULT 0 NOT NULL,
    unitprice numeric(24,8) DEFAULT 0,
    fk_user_creat integer,
    fk_user_modif integer,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_price_by_qty OWNER TO postgres;

--
-- TOC entry 558 (class 1259 OID 836461)
-- Name: llx_product_price_by_qty_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_price_by_qty_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_price_by_qty_rowid_seq OWNER TO postgres;

--
-- TOC entry 6622 (class 0 OID 0)
-- Dependencies: 558
-- Name: llx_product_price_by_qty_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_price_by_qty_rowid_seq OWNED BY public.llx_product_price_by_qty.rowid;


--
-- TOC entry 559 (class 1259 OID 836463)
-- Name: llx_product_price_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_price_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_price_rowid_seq OWNER TO postgres;

--
-- TOC entry 6623 (class 0 OID 0)
-- Dependencies: 559
-- Name: llx_product_price_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_price_rowid_seq OWNED BY public.llx_product_price.rowid;


--
-- TOC entry 560 (class 1259 OID 836465)
-- Name: llx_product_pricerules; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_pricerules (
    rowid integer NOT NULL,
    level integer NOT NULL,
    fk_level integer NOT NULL,
    var_percent numeric NOT NULL,
    var_min_percent numeric NOT NULL
);


ALTER TABLE public.llx_product_pricerules OWNER TO postgres;

--
-- TOC entry 561 (class 1259 OID 836471)
-- Name: llx_product_pricerules_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_pricerules_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_pricerules_rowid_seq OWNER TO postgres;

--
-- TOC entry 6624 (class 0 OID 0)
-- Dependencies: 561
-- Name: llx_product_pricerules_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_pricerules_rowid_seq OWNED BY public.llx_product_pricerules.rowid;


--
-- TOC entry 562 (class 1259 OID 836473)
-- Name: llx_product_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_rowid_seq OWNER TO postgres;

--
-- TOC entry 6625 (class 0 OID 0)
-- Dependencies: 562
-- Name: llx_product_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_rowid_seq OWNED BY public.llx_product.rowid;


--
-- TOC entry 563 (class 1259 OID 836475)
-- Name: llx_product_stock; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_stock (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product integer NOT NULL,
    fk_entrepot integer NOT NULL,
    reel real,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_stock OWNER TO postgres;

--
-- TOC entry 564 (class 1259 OID 836479)
-- Name: llx_product_stock_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_stock_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_stock_rowid_seq OWNER TO postgres;

--
-- TOC entry 6626 (class 0 OID 0)
-- Dependencies: 564
-- Name: llx_product_stock_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_stock_rowid_seq OWNED BY public.llx_product_stock.rowid;


--
-- TOC entry 565 (class 1259 OID 836481)
-- Name: llx_product_warehouse_properties; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_product_warehouse_properties (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_product integer NOT NULL,
    fk_entrepot integer NOT NULL,
    seuil_stock_alerte integer DEFAULT 0,
    desiredstock integer DEFAULT 0,
    import_key character varying(14)
);


ALTER TABLE public.llx_product_warehouse_properties OWNER TO postgres;

--
-- TOC entry 566 (class 1259 OID 836487)
-- Name: llx_product_warehouse_properties_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_product_warehouse_properties_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_product_warehouse_properties_rowid_seq OWNER TO postgres;

--
-- TOC entry 6627 (class 0 OID 0)
-- Dependencies: 566
-- Name: llx_product_warehouse_properties_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_product_warehouse_properties_rowid_seq OWNED BY public.llx_product_warehouse_properties.rowid;


--
-- TOC entry 567 (class 1259 OID 836489)
-- Name: llx_projet; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_projet (
    rowid integer NOT NULL,
    fk_soc integer,
    datec date,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    dateo date,
    datee date,
    ref character varying(50),
    entity integer DEFAULT 1 NOT NULL,
    title character varying(255) NOT NULL,
    description text,
    fk_user_creat integer NOT NULL,
    fk_user_modif integer,
    public integer,
    fk_statut integer DEFAULT 0 NOT NULL,
    fk_opp_status integer,
    opp_percent numeric(5,2),
    date_close timestamp without time zone,
    fk_user_close integer,
    note_private text,
    note_public text,
    opp_amount numeric(24,8),
    budget_amount numeric(24,8),
    model_pdf character varying(255),
    import_key character varying(14)
);


ALTER TABLE public.llx_projet OWNER TO postgres;

--
-- TOC entry 568 (class 1259 OID 836498)
-- Name: llx_projet_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_projet_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_projet_extrafields OWNER TO postgres;

--
-- TOC entry 569 (class 1259 OID 836502)
-- Name: llx_projet_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_projet_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_projet_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6628 (class 0 OID 0)
-- Dependencies: 569
-- Name: llx_projet_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_projet_extrafields_rowid_seq OWNED BY public.llx_projet_extrafields.rowid;


--
-- TOC entry 570 (class 1259 OID 836504)
-- Name: llx_projet_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_projet_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_projet_rowid_seq OWNER TO postgres;

--
-- TOC entry 6629 (class 0 OID 0)
-- Dependencies: 570
-- Name: llx_projet_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_projet_rowid_seq OWNED BY public.llx_projet.rowid;


--
-- TOC entry 571 (class 1259 OID 836506)
-- Name: llx_projet_task; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_projet_task (
    rowid integer NOT NULL,
    ref character varying(50),
    entity integer DEFAULT 1 NOT NULL,
    fk_projet integer NOT NULL,
    fk_task_parent integer DEFAULT 0 NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    dateo timestamp without time zone,
    datee timestamp without time zone,
    datev timestamp without time zone,
    label character varying(255) NOT NULL,
    description text,
    duration_effective real DEFAULT 0,
    planned_workload real DEFAULT 0,
    progress integer DEFAULT 0,
    priority integer DEFAULT 0,
    fk_user_creat integer,
    fk_user_valid integer,
    fk_statut smallint DEFAULT 0 NOT NULL,
    note_private text,
    note_public text,
    rang integer DEFAULT 0,
    model_pdf character varying(255),
    import_key character varying(14)
);


ALTER TABLE public.llx_projet_task OWNER TO postgres;

--
-- TOC entry 572 (class 1259 OID 836521)
-- Name: llx_projet_task_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_projet_task_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_projet_task_extrafields OWNER TO postgres;

--
-- TOC entry 573 (class 1259 OID 836525)
-- Name: llx_projet_task_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_projet_task_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_projet_task_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6630 (class 0 OID 0)
-- Dependencies: 573
-- Name: llx_projet_task_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_projet_task_extrafields_rowid_seq OWNED BY public.llx_projet_task_extrafields.rowid;


--
-- TOC entry 574 (class 1259 OID 836527)
-- Name: llx_projet_task_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_projet_task_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_projet_task_rowid_seq OWNER TO postgres;

--
-- TOC entry 6631 (class 0 OID 0)
-- Dependencies: 574
-- Name: llx_projet_task_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_projet_task_rowid_seq OWNED BY public.llx_projet_task.rowid;


--
-- TOC entry 575 (class 1259 OID 836529)
-- Name: llx_projet_task_time; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_projet_task_time (
    rowid integer NOT NULL,
    fk_task integer NOT NULL,
    task_date date,
    task_datehour timestamp without time zone,
    task_date_withhour integer DEFAULT 0,
    task_duration numeric,
    fk_user integer,
    thm numeric(24,8),
    invoice_id integer,
    invoice_line_id integer,
    import_key character varying(14),
    datec date,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    note text
);


ALTER TABLE public.llx_projet_task_time OWNER TO postgres;

--
-- TOC entry 576 (class 1259 OID 836537)
-- Name: llx_projet_task_time_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_projet_task_time_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_projet_task_time_rowid_seq OWNER TO postgres;

--
-- TOC entry 6632 (class 0 OID 0)
-- Dependencies: 576
-- Name: llx_projet_task_time_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_projet_task_time_rowid_seq OWNED BY public.llx_projet_task_time.rowid;


--
-- TOC entry 577 (class 1259 OID 836539)
-- Name: llx_propal; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_propal (
    rowid integer NOT NULL,
    ref character varying(30) NOT NULL,
    entity integer DEFAULT 1 NOT NULL,
    ref_ext character varying(255),
    ref_int character varying(255),
    ref_client character varying(255),
    fk_soc integer,
    fk_projet integer,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    datec timestamp without time zone,
    datep date,
    fin_validite timestamp without time zone,
    date_valid timestamp without time zone,
    date_cloture timestamp without time zone,
    fk_user_author integer,
    fk_user_modif integer,
    fk_user_valid integer,
    fk_user_cloture integer,
    fk_statut smallint DEFAULT 0 NOT NULL,
    price real DEFAULT 0,
    remise_percent real DEFAULT 0,
    remise_absolue real DEFAULT 0,
    remise real DEFAULT 0,
    total_ht numeric(24,8) DEFAULT 0,
    tva numeric(24,8) DEFAULT 0,
    localtax1 numeric(24,8) DEFAULT 0,
    localtax2 numeric(24,8) DEFAULT 0,
    total numeric(24,8) DEFAULT 0,
    fk_account integer,
    fk_currency character varying(3),
    fk_cond_reglement integer,
    fk_mode_reglement integer,
    note_private text,
    note_public text,
    model_pdf character varying(255),
    date_livraison date,
    fk_shipping_method integer,
    fk_availability integer,
    fk_input_reason integer,
    fk_incoterms integer,
    location_incoterms character varying(255),
    import_key character varying(14),
    extraparams character varying(255),
    fk_delivery_address integer,
    fk_multicurrency integer,
    multicurrency_code character varying(255),
    multicurrency_tx numeric(24,8) DEFAULT 1,
    multicurrency_total_ht numeric(24,8) DEFAULT 0,
    multicurrency_total_tva numeric(24,8) DEFAULT 0,
    multicurrency_total_ttc numeric(24,8) DEFAULT 0
);


ALTER TABLE public.llx_propal OWNER TO postgres;

--
-- TOC entry 578 (class 1259 OID 836561)
-- Name: llx_propal_extrafields; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_propal_extrafields (
    rowid integer NOT NULL,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    fk_object integer NOT NULL,
    import_key character varying(14)
);


ALTER TABLE public.llx_propal_extrafields OWNER TO postgres;

--
-- TOC entry 579 (class 1259 OID 836565)
-- Name: llx_propal_extrafields_rowid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.llx_propal_extrafields_rowid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.llx_propal_extrafields_rowid_seq OWNER TO postgres;

--
-- TOC entry 6633 (class 0 OID 0)
-- Dependencies: 579
-- Name: llx_propal_extrafields_rowid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.llx_propal_extrafields_rowid_seq OWNED BY public.llx_propal_extrafields.rowid;


--
-- TOC entry 580 (class 1259 OID 836567)
-- Name: llx_propal_merge_pdf_product; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.llx_propal_merge_pdf_product (
    rowid integer NOT NULL,
    fk_product integer NOT NULL,
    file_name character varying(200) NOT NULL,
    lang character varying(5) DEFAULT NULL::character varying,
    fk_user_author integer,
    fk_user_mod integer NOT NULL,
    datec timestamp without time zone,
    tms timestamp without time zone DEFAULT now() NOT NULL,
    import_key character varying(14) DEFAULT NULL::character varying
);


ALTER TABLE public.llx_propal_merge_pdf_product OWNER TO postgres;

--
-- TOC entry 581 (class 1259 OID 836573)
