-- Name: COLUMN recurtype.recurtype_schedcol; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_schedcol IS 'The name of the column in the recurtype_table holding the date or timestamp by which the item is scheduled to be completed or at which the event is supposed to occur.';


--
-- Name: COLUMN recurtype.recurtype_limit; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_limit IS 'A boolean expression that returns TRUE if the current user should see the row in the recurtype_table. NULL indicates there is no specific limitation. For example, the maintainance of recurring TODO items should restricted to those items belonging to the user unless s/he has been granted the privilege to modify other people''s todo lists.';


--
-- Name: COLUMN recurtype.recurtype_copyfunc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_copyfunc IS 'The name of the function to copy an existing item/event record. The copy function is expected to take at least 2 arguments: the id of the item to copy and the new date/timestamp. If the function accepts more than 2, it must be able to accept NULL values for the 3rd and following arguments.';


--
-- Name: COLUMN recurtype.recurtype_copyargs; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_copyargs IS 'An abbreviated argument list for the copy function. This is used to determine whether the second argument must be cast to a date or a timestamp, and to figure out how many additional arguments to pass.';


--
-- Name: COLUMN recurtype.recurtype_delfunc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN recurtype.recurtype_delfunc IS 'The name of the function to delete an existing item/event record. The function is expected to take exactly one argument: the id of the item to delete. NULL indicates there is no delete function and that an SQL DELETE statement can be used. In this case, the id column name will be built as the recurtype_table concatenated with the "_id" suffix.';


--
-- Name: recurtype_recurtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE recurtype_recurtype_id_seq OWNER TO admin;

--
-- Name: recurtype_recurtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE recurtype_recurtype_id_seq OWNED BY recurtype.recurtype_id;


--
-- Name: recv_recv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE recv_recv_id_seq OWNER TO admin;

--
-- Name: recv_recv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE recv_recv_id_seq OWNED BY recv.recv_id;


--
-- Name: remitto; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW remitto AS
    SELECT (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_name'::text)) AS remitto_name, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address1'::text)) AS remitto_address1, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address2'::text)) AS remitto_address2, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_address3'::text)) AS remitto_address3, (((((SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_city'::text)) || '  '::text) || (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_state'::text))) || '  '::text) || (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_zipcode'::text))) AS remitto_citystatezip, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_country'::text)) AS remitto_country, (SELECT metric.metric_value FROM metric WHERE (metric.metric_name = 'remitto_phone'::text)) AS remitto_phone;


ALTER TABLE remitto OWNER TO admin;

--
-- Name: rjctcode; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE rjctcode (
    rjctcode_id integer DEFAULT nextval(('"rjctcode_rjctcode_id_seq"'::text)::regclass) NOT NULL,
    rjctcode_code text NOT NULL,
    rjctcode_descrip text,
    CONSTRAINT rjctcode_rjctcode_code_check CHECK ((rjctcode_code <> ''::text))
);


ALTER TABLE rjctcode OWNER TO admin;

--
-- Name: TABLE rjctcode; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE rjctcode IS 'Reject Code information';


--
-- Name: rjctcode_rjctcode_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE rjctcode_rjctcode_id_seq OWNER TO admin;

--
-- Name: rsncode_rsncode_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE rsncode_rsncode_id_seq OWNER TO admin;

--
-- Name: rsncode_rsncode_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE rsncode_rsncode_id_seq OWNED BY rsncode.rsncode_id;


--
-- Name: sale; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sale (
    sale_id integer DEFAULT nextval(('"sale_sale_id_seq"'::text)::regclass) NOT NULL,
    sale_name text NOT NULL,
    sale_descrip text,
    sale_ipshead_id integer,
    sale_startdate date,
    sale_enddate date,
    CONSTRAINT sale_sale_name_check CHECK ((sale_name <> ''::text))
);


ALTER TABLE sale OWNER TO admin;

--
-- Name: TABLE sale; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sale IS 'Sale information';


--
-- Name: sale_sale_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE sale_sale_id_seq OWNER TO admin;

--
-- Name: salesaccnt_salesaccnt_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE salesaccnt_salesaccnt_id_seq OWNER TO admin;

--
-- Name: salescat_salescat_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE salescat_salescat_id_seq OWNER TO admin;

--
-- Name: salescat_salescat_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE salescat_salescat_id_seq OWNED BY salescat.salescat_id;


--
-- Name: saleshistory; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW saleshistory AS
    SELECT data.cohist_id, data.cohist_cust_id, data.cohist_itemsite_id, data.cohist_shipdate, data.cohist_shipvia, data.cohist_ordernumber, data.cohist_orderdate, data.cohist_invcnumber, data.cohist_invcdate, data.cohist_qtyshipped, data.cohist_unitprice, data.cohist_shipto_id, data.cohist_salesrep_id, data.cohist_duedate, data.cohist_imported, data.cohist_billtoname, data.cohist_billtoaddress1, data.cohist_billtoaddress2, data.cohist_billtoaddress3, data.cohist_billtocity, data.cohist_billtostate, data.cohist_billtozip, data.cohist_shiptoname, data.cohist_shiptoaddress1, data.cohist_shiptoaddress2, data.cohist_shiptoaddress3, data.cohist_shiptocity, data.cohist_shiptostate, data.cohist_shiptozip, data.cohist_commission, data.cohist_commissionpaid, data.cohist_unitcost, data.cohist_misc_type, data.cohist_misc_descrip, data.cohist_misc_id, data.cohist_doctype, data.cohist_promisedate, data.cohist_ponumber, data.cohist_curr_id, data.cohist_sequence, data.cohist_taxtype_id, data.cohist_taxzone_id, data.cohist_cohead_ccpay_id, data.cohist_saletype_id, data.cohist_shipzone_id, data.cohead_id, data.cust_id, data.cust_number, data.cust_name, data.cust_curr_id, data.custtype_id, data.custtype_code, data.custtype_descrip, data.salesrep_id, data.salesrep_number, data.salesrep_name, data.shipzone_id, data.shipzone_name, data.shipzone_descrip, data.saletype_code, data.saletype_descr, data.itemsite_id, data.warehous_id, data.warehous_code, data.warehous_descrip, data.item_id, data.item_number, data.item_descrip1, data.item_descrip2, data.itemdescription, data.itemnumber, data.prodcat_id, data.prodcat_code, data.classcode_id, data.classcode_code, data.basecommission, data.baseunitprice, data.custunitprice, round((data.cohist_qtyshipped * data.cohist_unitprice), 2) AS extprice, round((data.cohist_qtyshipped * data.baseunitprice), 2) AS baseextprice, round((data.cohist_qtyshipped * data.custunitprice), 2) AS custextprice, round((data.cohist_qtyshipped * data.cohist_unitcost), 4) AS extcost, round(((data.cohist_qtyshipped * data.baseunitprice) - (data.cohist_qtyshipped * data.cohist_unitcost)), 2) AS margin, CASE WHEN (round((data.cohist_qtyshipped * data.baseunitprice), 2) > 0.0) THEN (round(((data.cohist_qtyshipped * data.baseunitprice) - (data.cohist_qtyshipped * data.cohist_unitcost)), 2) / round((data.cohist_qtyshipped * data.baseunitprice), 2)) ELSE 0.0 END AS marginpercent, currconcat(data.cohist_curr_id) AS currabbr, 'qty'::text AS cohist_qtyshipped_xtnumericrole, 'salesprice'::text AS cohist_unitprice_xtnumericrole, 'salesprice'::text AS baseunitprice_xtnumericrole, 'curr'::text AS custunitprice_xtnumericrole, 'curr'::text AS custextprice_xtnumericrole, 'curr'::text AS extprice_xtnumericrole, 'curr'::text AS baseextprice_xtnumericrole, 'cost'::text AS cohist_unitcost_xtnumericrole, 'curr'::text AS extcost_xtnumericrole, 'curr'::text AS margin_xtnumericrole, 'percent'::text AS marginpercent_xtnumericrole, 'curr'::text AS cohist_commission_xtnumericrole, 'curr'::text AS basecommission_xtnumericrole FROM (SELECT cohist.cohist_id, cohist.cohist_cust_id, cohist.cohist_itemsite_id, cohist.cohist_shipdate, cohist.cohist_shipvia, cohist.cohist_ordernumber, cohist.cohist_orderdate, cohist.cohist_invcnumber, cohist.cohist_invcdate, cohist.cohist_qtyshipped, cohist.cohist_unitprice, cohist.cohist_shipto_id, cohist.cohist_salesrep_id, cohist.cohist_duedate, cohist.cohist_imported, cohist.cohist_billtoname, cohist.cohist_billtoaddress1, cohist.cohist_billtoaddress2, cohist.cohist_billtoaddress3, cohist.cohist_billtocity, cohist.cohist_billtostate, cohist.cohist_billtozip, cohist.cohist_shiptoname, cohist.cohist_shiptoaddress1, cohist.cohist_shiptoaddress2, cohist.cohist_shiptoaddress3, cohist.cohist_shiptocity, cohist.cohist_shiptostate, cohist.cohist_shiptozip, cohist.cohist_commission, cohist.cohist_commissionpaid, cohist.cohist_unitcost, cohist.cohist_misc_type, cohist.cohist_misc_descrip, cohist.cohist_misc_id, cohist.cohist_doctype, cohist.cohist_promisedate, cohist.cohist_ponumber, cohist.cohist_curr_id, cohist.cohist_sequence, cohist.cohist_taxtype_id, cohist.cohist_taxzone_id, cohist.cohist_cohead_ccpay_id, cohist.cohist_saletype_id, cohist.cohist_shipzone_id, COALESCE(cohead.cohead_id, (-1)) AS cohead_id, custinfo.cust_id, custinfo.cust_number, custinfo.cust_name, custinfo.cust_curr_id, custtype.custtype_id, custtype.custtype_code, custtype.custtype_descrip, salesrep.salesrep_id, salesrep.salesrep_number, salesrep.salesrep_name, shipzone.shipzone_id, shipzone.shipzone_name, shipzone.shipzone_descrip, saletype.saletype_code, saletype.saletype_descr, itemsite.itemsite_id, site.warehous_id, site.warehous_code, site.warehous_descrip, item.item_id, item.item_number, item.item_descrip1, item.item_descrip2, ((item.item_descrip1 || ' '::text) || item.item_descrip2) AS itemdescription, COALESCE(item.item_number, cohist.cohist_misc_descrip) AS itemnumber, prodcat.prodcat_id, prodcat.prodcat_code, classcode.classcode_id, classcode.classcode_code, currtobase(cohist.cohist_curr_id, cohist.cohist_commission, cohist.cohist_invcdate) AS basecommission, currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS baseunitprice, currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS custunitprice FROM ((((((((((((cohist JOIN custinfo ON ((custinfo.cust_id = cohist.cohist_cust_id))) LEFT JOIN cohead ON ((cohead.cohead_number = cohist.cohist_ordernumber))) LEFT JOIN custtype ON ((custtype.custtype_id = custinfo.cust_custtype_id))) LEFT JOIN salesrep ON ((salesrep.salesrep_id = cohist.cohist_salesrep_id))) LEFT JOIN shiptoinfo ON ((shiptoinfo.shipto_id = cohist.cohist_shipto_id))) LEFT JOIN shipzone ON ((shipzone.shipzone_id = shiptoinfo.shipto_shipzone_id))) LEFT JOIN saletype ON ((saletype.saletype_id = cohist.cohist_saletype_id))) JOIN itemsite ON ((itemsite.itemsite_id = cohist.cohist_itemsite_id))) JOIN site() site(warehous_id, warehous_code, warehous_descrip, warehous_fob, warehous_active, warehous_counttag_prefix, warehous_counttag_number, warehous_bol_prefix, warehous_bol_number, warehous_shipping, warehous_useslips, warehous_usezones, warehous_aislesize, warehous_aislealpha, warehous_racksize, warehous_rackalpha, warehous_binsize, warehous_binalpha, warehous_locationsize, warehous_locationalpha, warehous_enforcearbl, warehous_default_accnt_id, warehous_shipping_commission, warehous_cntct_id, warehous_addr_id, warehous_transit, warehous_shipform_id, warehous_shipvia_id, warehous_shipcomments, warehous_costcat_id, warehous_sitetype_id, warehous_taxzone_id, warehous_sequence) ON ((site.warehous_id = itemsite.itemsite_warehous_id))) JOIN item ON ((item.item_id = itemsite.itemsite_item_id))) JOIN prodcat ON ((prodcat.prodcat_id = item.item_prodcat_id))) JOIN classcode ON ((classcode.classcode_id = item.item_classcode_id)))) data;


ALTER TABLE saleshistory OWNER TO admin;

--
-- Name: VIEW saleshistory; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON VIEW saleshistory IS 'Single point for sales history calculations.';


--
-- Name: saleshistorymisc; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW saleshistorymisc AS
    SELECT data.cohist_id, data.cohist_cust_id, data.cohist_itemsite_id, data.cohist_shipdate, data.cohist_shipvia, data.cohist_ordernumber, data.cohist_orderdate, data.cohist_invcnumber, data.cohist_invcdate, data.cohist_qtyshipped, data.cohist_unitprice, data.cohist_shipto_id, data.cohist_salesrep_id, data.cohist_duedate, data.cohist_imported, data.cohist_billtoname, data.cohist_billtoaddress1, data.cohist_billtoaddress2, data.cohist_billtoaddress3, data.cohist_billtocity, data.cohist_billtostate, data.cohist_billtozip, data.cohist_shiptoname, data.cohist_shiptoaddress1, data.cohist_shiptoaddress2, data.cohist_shiptoaddress3, data.cohist_shiptocity, data.cohist_shiptostate, data.cohist_shiptozip, data.cohist_commission, data.cohist_commissionpaid, data.cohist_unitcost, data.cohist_misc_type, data.cohist_misc_descrip, data.cohist_misc_id, data.cohist_doctype, data.cohist_promisedate, data.cohist_ponumber, data.cohist_curr_id, data.cohist_sequence, data.cohist_taxtype_id, data.cohist_taxzone_id, data.cohist_cohead_ccpay_id, data.cohist_saletype_id, data.cohist_shipzone_id, data.cohead_id, data.cust_id, data.cust_number, data.cust_name, data.cust_curr_id, data.custtype_id, data.custtype_code, data.custtype_descrip, data.salesrep_id, data.salesrep_number, data.salesrep_name, data.shipzone_id, data.shipzone_name, data.shipzone_descrip, data.saletype_code, data.saletype_descr, data.itemsite_id, data.warehous_id, data.warehous_code, data.warehous_descrip, data.item_id, data.item_number, data.item_descrip1, data.item_descrip2, data.itemdescription, data.itemnumber, data.prodcat_id, data.prodcat_code, data.classcode_id, data.classcode_code, data.basecommission, data.baseunitprice, data.custunitprice, round((data.cohist_qtyshipped * data.cohist_unitprice), 2) AS extprice, round((data.cohist_qtyshipped * data.baseunitprice), 2) AS baseextprice, round((data.cohist_qtyshipped * data.custunitprice), 2) AS custextprice, round((data.cohist_qtyshipped * data.cohist_unitcost), 4) AS extcost, round(((data.cohist_qtyshipped * data.baseunitprice) - (data.cohist_qtyshipped * data.cohist_unitcost)), 2) AS margin, CASE WHEN (round((data.cohist_qtyshipped * data.baseunitprice), 2) > 0.0) THEN (round(((data.cohist_qtyshipped * data.baseunitprice) - (data.cohist_qtyshipped * data.cohist_unitcost)), 2) / round((data.cohist_qtyshipped * data.baseunitprice), 2)) ELSE 0.0 END AS marginpercent, currconcat(data.cohist_curr_id) AS currabbr, 'qty'::text AS cohist_qtyshipped_xtnumericrole, 'salesprice'::text AS cohist_unitprice_xtnumericrole, 'salesprice'::text AS baseunitprice_xtnumericrole, 'curr'::text AS custunitprice_xtnumericrole, 'curr'::text AS custextprice_xtnumericrole, 'curr'::text AS extprice_xtnumericrole, 'curr'::text AS baseextprice_xtnumericrole, 'cost'::text AS cohist_unitcost_xtnumericrole, 'curr'::text AS extcost_xtnumericrole, 'curr'::text AS margin_xtnumericrole, 'percent'::text AS marginpercent_xtnumericrole, 'curr'::text AS cohist_commission_xtnumericrole, 'curr'::text AS basecommission_xtnumericrole FROM (SELECT cohist.cohist_id, cohist.cohist_cust_id, cohist.cohist_itemsite_id, cohist.cohist_shipdate, cohist.cohist_shipvia, cohist.cohist_ordernumber, cohist.cohist_orderdate, cohist.cohist_invcnumber, cohist.cohist_invcdate, cohist.cohist_qtyshipped, cohist.cohist_unitprice, cohist.cohist_shipto_id, cohist.cohist_salesrep_id, cohist.cohist_duedate, cohist.cohist_imported, cohist.cohist_billtoname, cohist.cohist_billtoaddress1, cohist.cohist_billtoaddress2, cohist.cohist_billtoaddress3, cohist.cohist_billtocity, cohist.cohist_billtostate, cohist.cohist_billtozip, cohist.cohist_shiptoname, cohist.cohist_shiptoaddress1, cohist.cohist_shiptoaddress2, cohist.cohist_shiptoaddress3, cohist.cohist_shiptocity, cohist.cohist_shiptostate, cohist.cohist_shiptozip, cohist.cohist_commission, cohist.cohist_commissionpaid, cohist.cohist_unitcost, cohist.cohist_misc_type, cohist.cohist_misc_descrip, cohist.cohist_misc_id, cohist.cohist_doctype, cohist.cohist_promisedate, cohist.cohist_ponumber, cohist.cohist_curr_id, cohist.cohist_sequence, cohist.cohist_taxtype_id, cohist.cohist_taxzone_id, cohist.cohist_cohead_ccpay_id, cohist.cohist_saletype_id, cohist.cohist_shipzone_id, COALESCE(cohead.cohead_id, (-1)) AS cohead_id, custinfo.cust_id, custinfo.cust_number, custinfo.cust_name, custinfo.cust_curr_id, custtype.custtype_id, custtype.custtype_code, custtype.custtype_descrip, salesrep.salesrep_id, salesrep.salesrep_number, salesrep.salesrep_name, shipzone.shipzone_id, shipzone.shipzone_name, shipzone.shipzone_descrip, saletype.saletype_code, saletype.saletype_descr, itemsite.itemsite_id, site.warehous_id, site.warehous_code, site.warehous_descrip, item.item_id, item.item_number, item.item_descrip1, item.item_descrip2, ((item.item_descrip1 || ' '::text) || item.item_descrip2) AS itemdescription, COALESCE(item.item_number, cohist.cohist_misc_descrip) AS itemnumber, prodcat.prodcat_id, prodcat.prodcat_code, classcode.classcode_id, classcode.classcode_code, currtobase(cohist.cohist_curr_id, cohist.cohist_commission, cohist.cohist_invcdate) AS basecommission, currtobase(cohist.cohist_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS baseunitprice, currtocurr(cohist.cohist_curr_id, custinfo.cust_curr_id, cohist.cohist_unitprice, cohist.cohist_invcdate) AS custunitprice FROM ((((((((((((cohist JOIN custinfo ON ((custinfo.cust_id = cohist.cohist_cust_id))) LEFT JOIN cohead ON ((cohead.cohead_number = cohist.cohist_ordernumber))) LEFT JOIN custtype ON ((custtype.custtype_id = custinfo.cust_custtype_id))) LEFT JOIN salesrep ON ((salesrep.salesrep_id = cohist.cohist_salesrep_id))) LEFT JOIN shiptoinfo ON ((shiptoinfo.shipto_id = cohist.cohist_shipto_id))) LEFT JOIN shipzone ON ((shipzone.shipzone_id = shiptoinfo.shipto_shipzone_id))) LEFT JOIN saletype ON ((saletype.saletype_id = cohist.cohist_saletype_id))) LEFT JOIN itemsite ON ((itemsite.itemsite_id = cohist.cohist_itemsite_id))) LEFT JOIN site() site(warehous_id, warehous_code, warehous_descrip, warehous_fob, warehous_active, warehous_counttag_prefix, warehous_counttag_number, warehous_bol_prefix, warehous_bol_number, warehous_shipping, warehous_useslips, warehous_usezones, warehous_aislesize, warehous_aislealpha, warehous_racksize, warehous_rackalpha, warehous_binsize, warehous_binalpha, warehous_locationsize, warehous_locationalpha, warehous_enforcearbl, warehous_default_accnt_id, warehous_shipping_commission, warehous_cntct_id, warehous_addr_id, warehous_transit, warehous_shipform_id, warehous_shipvia_id, warehous_shipcomments, warehous_costcat_id, warehous_sitetype_id, warehous_taxzone_id, warehous_sequence) ON ((site.warehous_id = itemsite.itemsite_warehous_id))) LEFT JOIN item ON ((item.item_id = itemsite.itemsite_item_id))) LEFT JOIN prodcat ON ((prodcat.prodcat_id = item.item_prodcat_id))) LEFT JOIN classcode ON ((classcode.classcode_id = item.item_classcode_id))) WHERE ((COALESCE(cohist.cohist_misc_type, ''::bpchar) <> 'F'::bpchar) AND (COALESCE(cohist.cohist_misc_type, ''::bpchar) <> 'T'::bpchar))) data;


ALTER TABLE saleshistorymisc OWNER TO admin;

--
-- Name: VIEW saleshistorymisc; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON VIEW saleshistorymisc IS 'Single point for sales history (including misc. items) calculations.';


--
-- Name: salesrep_salesrep_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE salesrep_salesrep_id_seq OWNER TO admin;

--
-- Name: saletype_saletype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE saletype_saletype_id_seq OWNER TO admin;

--
-- Name: saletype_saletype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE saletype_saletype_id_seq OWNED BY saletype.saletype_id;


--
-- Name: schemaord; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE schemaord (
    schemaord_id integer NOT NULL,
    schemaord_name text NOT NULL,
    schemaord_order integer NOT NULL,
    CONSTRAINT schemaord_schemaord_name_check CHECK ((length(schemaord_name) > 0)),
    CONSTRAINT schemaord_schemaord_name_check1 CHECK ((schemaord_name <> ''::text))
);


ALTER TABLE schemaord OWNER TO admin;

--
-- Name: TABLE schemaord; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE schemaord IS 'Set the order in which db schemas will appear in the search path after login';


--
-- Name: schemaord_schemaord_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE schemaord_schemaord_id_seq OWNER TO admin;

--
-- Name: schemaord_schemaord_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE schemaord_schemaord_id_seq OWNED BY schemaord.schemaord_id;


--
-- Name: sequence; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sequence (
    sequence_value integer
);


ALTER TABLE sequence OWNER TO admin;

--
-- Name: TABLE sequence; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sequence IS 'Pre-populated list of sequence numbers (1-1000) used for printing Labels and other uses';


--
-- Name: shift_shift_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shift_shift_id_seq OWNER TO admin;

--
-- Name: shift_shift_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shift_shift_id_seq OWNED BY shift.shift_id;


--
-- Name: shipchrg_shipchrg_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipchrg_shipchrg_id_seq OWNER TO admin;

--
-- Name: shipchrg_shipchrg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shipchrg_shipchrg_id_seq OWNED BY shipchrg.shipchrg_id;


--
-- Name: shipdatasum; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE shipdatasum (
    shipdatasum_cohead_number text NOT NULL,
    shipdatasum_cosmisc_tracknum text NOT NULL,
    shipdatasum_cosmisc_packnum_tracknum text NOT NULL,
    shipdatasum_weight numeric(16,4),
    shipdatasum_base_freight numeric(16,4),
    shipdatasum_total_freight numeric(16,4),
    shipdatasum_shipper text DEFAULT 'UPS'::text,
    shipdatasum_billing_option text,
    shipdatasum_package_type text,
    shipdatasum_lastupdated timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
    shipdatasum_shipped boolean DEFAULT false,
    shipdatasum_shiphead_number text,
    shipdatasum_base_freight_curr_id integer DEFAULT basecurrid(),
    shipdatasum_total_freight_curr_id integer DEFAULT basecurrid()
);


ALTER TABLE shipdatasum OWNER TO admin;

--
-- Name: TABLE shipdatasum; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE shipdatasum IS 'Shipping Interface information.';


--
-- Name: shipform_shipform_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipform_shipform_id_seq OWNER TO admin;

--
-- Name: shiphead_shiphead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shiphead_shiphead_id_seq OWNER TO admin;

--
-- Name: shiphead_shiphead_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shiphead_shiphead_id_seq OWNED BY shiphead.shiphead_id;


--
-- Name: shipitem_shipitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipitem_shipitem_id_seq OWNER TO admin;

--
-- Name: shipitem_shipitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE shipitem_shipitem_id_seq OWNED BY shipitem.shipitem_id;


--
-- Name: shipment_number_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipment_number_seq OWNER TO admin;

--
-- Name: shipto; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW shipto AS
    SELECT shiptoinfo.shipto_id, shiptoinfo.shipto_cust_id, shiptoinfo.shipto_name, m.addr_line1 AS shipto_address1, m.addr_line2 AS shipto_address2, m.addr_line3 AS shipto_address3, m.addr_city AS shipto_city, m.addr_state AS shipto_state, m.addr_postalcode AS shipto_zipcode, shiptoinfo.shipto_taxzone_id, shiptoinfo.shipto_salesrep_id, c1.cntct_phone AS shipto_phone, shiptoinfo.shipto_comments, shiptoinfo.shipto_shipcomments, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS shipto_contact, c1.cntct_fax AS shipto_fax, c1.cntct_email AS shipto_email, shiptoinfo.shipto_shipzone_id, shiptoinfo.shipto_shipvia, shiptoinfo.shipto_commission, shiptoinfo.shipto_shipform_id, shiptoinfo.shipto_shipchrg_id, shiptoinfo.shipto_active, shiptoinfo.shipto_default, shiptoinfo.shipto_num, shiptoinfo.shipto_ediprofile_id, m.addr_country AS shipto_country FROM ((shiptoinfo LEFT JOIN cntct c1 ON ((shiptoinfo.shipto_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((shiptoinfo.shipto_addr_id = m.addr_id)));


ALTER TABLE shipto OWNER TO admin;

--
-- Name: shipto_shipto_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipto_shipto_id_seq OWNER TO admin;

--
-- Name: shipvia_shipvia_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipvia_shipvia_id_seq OWNER TO admin;

--
-- Name: shipzone_shipzone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE shipzone_shipzone_id_seq OWNER TO admin;

--
-- Name: sitetype_sitetype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE sitetype_sitetype_id_seq OWNER TO admin;

--
-- Name: sitetype_sitetype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE sitetype_sitetype_id_seq OWNED BY sitetype.sitetype_id;


--
-- Name: sltrans; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sltrans (
    sltrans_id integer DEFAULT nextval('gltrans_gltrans_id_seq'::regclass) NOT NULL,
    sltrans_created timestamp with time zone,
    sltrans_date date NOT NULL,
    sltrans_sequence integer,
    sltrans_accnt_id integer NOT NULL,
    sltrans_source text,
    sltrans_docnumber text,
    sltrans_misc_id integer,
    sltrans_amount numeric(20,2) NOT NULL,
    sltrans_notes text,
    sltrans_journalnumber integer,
    sltrans_posted boolean NOT NULL,
    sltrans_doctype text,
    sltrans_username text DEFAULT geteffectivextuser() NOT NULL,
    sltrans_gltrans_journalnumber integer,
    sltrans_rec boolean DEFAULT false NOT NULL
);


ALTER TABLE sltrans OWNER TO admin;

--
-- Name: TABLE sltrans; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sltrans IS 'Journal transaction information';


--
-- Name: sltrans_backup; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE sltrans_backup (
    sltrans_old_id integer,
    sltrans_new_id integer
);


ALTER TABLE sltrans_backup OWNER TO admin;

--
-- Name: TABLE sltrans_backup; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE sltrans_backup IS 'backup cross references of old and new ids for sltrans 4.0 upgrade.';


--
-- Name: sopack; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW sopack AS
    SELECT pack.pack_id AS sopack_id, pack.pack_head_id AS sopack_sohead_id, pack.pack_printed AS sopack_printed, pack.pack_shiphead_id AS sopack_cosmisc_id FROM pack WHERE (pack.pack_head_type = 'SO'::text);


ALTER TABLE sopack OWNER TO admin;

--
-- Name: sopack_sopack_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE sopack_sopack_id_seq OWNER TO admin;

--
-- Name: source; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE source (
    source_id integer NOT NULL,
    source_module text,
    source_name text NOT NULL,
    source_descrip text,
    source_docass_num integer DEFAULT 0 NOT NULL,
    source_docass text DEFAULT ''::text NOT NULL,
    source_charass text DEFAULT ''::text NOT NULL,
    source_table text DEFAULT ''::text NOT NULL,
    source_key_field text DEFAULT ''::text NOT NULL,
    source_number_field text DEFAULT ''::text NOT NULL,
    source_name_field text DEFAULT ''::text NOT NULL,
    source_desc_field text DEFAULT ''::text NOT NULL,
    source_widget text DEFAULT ''::text NOT NULL,
    source_joins text DEFAULT ''::text NOT NULL,
    source_key_param text DEFAULT ''::text NOT NULL,
    source_uiform_name text DEFAULT ''::text NOT NULL,
    source_create_priv text DEFAULT ''::text NOT NULL,
    source_created timestamp with time zone DEFAULT now() NOT NULL,
    source_last_modified timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT source_source_name_check CHECK ((source_name <> ''::text))
);


ALTER TABLE source OWNER TO admin;

--
-- Name: TABLE source; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE source IS 'Used to describe different types of document for tax classes, document associations, comment associations, and characteristic associations';


--
-- Name: COLUMN source.source_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_id IS 'Primary key';


--
-- Name: COLUMN source.source_module; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_module IS 'Application module';


--
-- Name: COLUMN source.source_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_name IS 'Abbreviation for this document type used on comment associations.';


--
-- Name: COLUMN source.source_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_descrip IS 'Human-readable English name for this document type. The client application tries to translate this whenever possible.';


--
-- Name: COLUMN source.source_docass_num; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_docass_num IS 'Value from the desktop client''s Document::DocumentSources enumeration corresponding to this document type.';


--
-- Name: COLUMN source.source_docass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_docass IS 'Abbreviation for this document type used on document associations (docass). Empty indicates cannot used for document associations (see source_widget).';


--
-- Name: COLUMN source.source_charass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_charass IS 'Abbreviation for this document type used on characteristic associations (charass). Empty indicates not used for characteristics.';


--
-- Name: COLUMN source.source_table; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_table IS 'The primary table in which this document is stored.';


--
-- Name: COLUMN source.source_key_field; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_key_field IS 'The primary key field in the primary table for this document type.';


--
-- Name: COLUMN source.source_number_field; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_number_field IS 'The column holding the main human-readable identifier for this document (e.g. Bill of Materials document number).';


--
-- Name: COLUMN source.source_name_field; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_name_field IS 'The column holding the secondary description of this document (e.g. the Item built by a Bill of Materials).';


--
-- Name: COLUMN source.source_desc_field; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_desc_field IS 'The column holding the longer description of this document (e.g. the first line of the Item''s Description for a Bill of Materials).';


--
-- Name: COLUMN source.source_widget; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_widget IS 'A hint to the client application of how to let the user select a document to attach. "core" means that the C++ application handles this document type natively. A value starting with "SELECT" is interpreted as a query to populate a combobox, while values containing "Cluster" are treated as the name of a C++ VirtualCluster subclass to instantiate. Empty string means this cannot be used by the desktop client to create document associations (see source_docass).';


--
-- Name: COLUMN source.source_joins; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_joins IS 'An optional string to add to the FROM clause to get auxiliary information (e.g. "join item_id on bomhead_item_id=item_id").';


--
-- Name: COLUMN source.source_key_param; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_key_param IS 'The name of the parameter interpreted by the desktop client''s "set" method as containing the primary key to retrieve the main document record for editing or viewing (e.g. most desktop windows take the sales order id in a "sohead_id" parameter even though the database field is "cohead_id").';


--
-- Name: COLUMN source.source_uiform_name; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_uiform_name IS 'The name of the desktop client application window to open to view or edit this document (e.g. "salesOrder").';


--
-- Name: COLUMN source.source_create_priv; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_create_priv IS 'A space- or +-delimited set of privileges required to allow creating a new document. If this is specified, an item will be added to the desktop client''s "New" button menu.';


--
-- Name: COLUMN source.source_created; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_created IS 'The date this source record was created (or the date this column was added to the table:-).';


--
-- Name: COLUMN source.source_last_modified; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN source.source_last_modified IS 'The date this source record was last edited.';


--
-- Name: source_source_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE source_source_id_seq OWNER TO admin;

--
-- Name: source_source_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE source_source_id_seq OWNED BY source.source_id;


--
-- Name: state; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE state (
    state_id integer NOT NULL,
    state_name text NOT NULL,
    state_abbr text,
    state_country_id integer,
    CONSTRAINT state_state_name_check CHECK ((state_name <> ''::text))
);


ALTER TABLE state OWNER TO admin;

--
-- Name: TABLE state; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE state IS 'List of states, provinces, and territories associated with various countries.';


--
-- Name: state_state_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE state_state_id_seq OWNER TO admin;

--
-- Name: state_state_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE state_state_id_seq OWNED BY state.state_id;


--
-- Name: status; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE status (
    status_id integer NOT NULL,
    status_type text NOT NULL,
    status_code character(1) NOT NULL,
    status_name text,
    status_seq integer,
    status_color text DEFAULT 'white'::text
);


ALTER TABLE status OWNER TO admin;

--
-- Name: status_status_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE status_status_id_seq OWNER TO admin;

--
-- Name: status_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE status_status_id_seq OWNED BY status.status_id;


--
-- Name: stdjrnl; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnl (
    stdjrnl_id integer NOT NULL,
    stdjrnl_name text NOT NULL,
    stdjrnl_descrip text,
    stdjrnl_notes text,
    CONSTRAINT stdjrnl_stdjrnl_name_check CHECK ((stdjrnl_name <> ''::text))
);


ALTER TABLE stdjrnl OWNER TO admin;

--
-- Name: TABLE stdjrnl; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnl IS 'Standard Journal information';


--
-- Name: stdjrnl_stdjrnl_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE stdjrnl_stdjrnl_id_seq OWNER TO admin;

--
-- Name: stdjrnl_stdjrnl_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnl_stdjrnl_id_seq OWNED BY stdjrnl.stdjrnl_id;


--
-- Name: stdjrnlgrp; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlgrp (
    stdjrnlgrp_id integer NOT NULL,
    stdjrnlgrp_name text NOT NULL,
    stdjrnlgrp_descrip text,
    CONSTRAINT stdjrnlgrp_stdjrnlgrp_name_check CHECK ((stdjrnlgrp_name <> ''::text))
);


ALTER TABLE stdjrnlgrp OWNER TO admin;

--
-- Name: TABLE stdjrnlgrp; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlgrp IS 'Standard Journal Group information';


--
-- Name: stdjrnlgrp_stdjrnlgrp_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE stdjrnlgrp_stdjrnlgrp_id_seq OWNER TO admin;

--
-- Name: stdjrnlgrp_stdjrnlgrp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlgrp_stdjrnlgrp_id_seq OWNED BY stdjrnlgrp.stdjrnlgrp_id;


--
-- Name: stdjrnlgrpitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlgrpitem (
    stdjrnlgrpitem_id integer NOT NULL,
    stdjrnlgrpitem_stdjrnl_id integer,
    stdjrnlgrpitem_toapply integer,
    stdjrnlgrpitem_applied integer,
    stdjrnlgrpitem_effective date,
    stdjrnlgrpitem_expires date,
    stdjrnlgrpitem_stdjrnlgrp_id integer
);


ALTER TABLE stdjrnlgrpitem OWNER TO admin;

--
-- Name: TABLE stdjrnlgrpitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlgrpitem IS 'Standard Journal Group Item information';


--
-- Name: stdjrnlgrpitem_stdjrnlgrpitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE stdjrnlgrpitem_stdjrnlgrpitem_id_seq OWNER TO admin;

--
-- Name: stdjrnlgrpitem_stdjrnlgrpitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlgrpitem_stdjrnlgrpitem_id_seq OWNED BY stdjrnlgrpitem.stdjrnlgrpitem_id;


--
-- Name: stdjrnlitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE stdjrnlitem (
    stdjrnlitem_id integer NOT NULL,
    stdjrnlitem_stdjrnl_id integer NOT NULL,
    stdjrnlitem_accnt_id integer NOT NULL,
    stdjrnlitem_amount numeric(20,2) NOT NULL,
    stdjrnlitem_notes text
);


ALTER TABLE stdjrnlitem OWNER TO admin;

--
-- Name: TABLE stdjrnlitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE stdjrnlitem IS 'Standard Journal Item information';


--
-- Name: stdjrnlitem_stdjrnlitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE stdjrnlitem_stdjrnlitem_id_seq OWNER TO admin;

--
-- Name: stdjrnlitem_stdjrnlitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE stdjrnlitem_stdjrnlitem_id_seq OWNED BY stdjrnlitem.stdjrnlitem_id;


--
-- Name: subaccnt; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE subaccnt (
    subaccnt_id integer NOT NULL,
    subaccnt_number text NOT NULL,
    subaccnt_descrip text,
    CONSTRAINT subaccnt_subaccnt_number_check CHECK ((subaccnt_number <> ''::text))
);


ALTER TABLE subaccnt OWNER TO admin;

--
-- Name: TABLE subaccnt; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE subaccnt IS 'Subaccount information';


--
-- Name: subaccnt_subaccnt_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE subaccnt_subaccnt_id_seq OWNER TO admin;

--
-- Name: subaccnt_subaccnt_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE subaccnt_subaccnt_id_seq OWNED BY subaccnt.subaccnt_id;


--
-- Name: subaccnttype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE subaccnttype (
    subaccnttype_id integer NOT NULL,
    subaccnttype_accnt_type character(1) NOT NULL,
    subaccnttype_code text NOT NULL,
    subaccnttype_descrip text
);


ALTER TABLE subaccnttype OWNER TO admin;

--
-- Name: TABLE subaccnttype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE subaccnttype IS 'User defined Sub Account Types.';


--
-- Name: subaccnttype_subaccnttype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE subaccnttype_subaccnttype_id_seq OWNER TO admin;

--
-- Name: subaccnttype_subaccnttype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE subaccnttype_subaccnttype_id_seq OWNED BY subaccnttype.subaccnttype_id;


--
-- Name: tax_tax_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE tax_tax_id_seq OWNER TO admin;

--
-- Name: taxass; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxass (
    taxass_id integer NOT NULL,
    taxass_taxzone_id integer,
    taxass_taxtype_id integer,
    taxass_tax_id integer NOT NULL
);


ALTER TABLE taxass OWNER TO admin;

--
-- Name: TABLE taxass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxass IS 'The tax assignment table associates different tax zones and tax types to a given set of tax codes.';


--
-- Name: COLUMN taxass.taxass_taxzone_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_taxzone_id IS 'The id of the tax zone. If NULL any tax zone will apply.';


--
-- Name: COLUMN taxass.taxass_taxtype_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_taxtype_id IS 'The id of the tax type. If NULL any tax type will apply.';


--
-- Name: COLUMN taxass.taxass_tax_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxass.taxass_tax_id IS 'The id of the tax code.';


--
-- Name: taxass_taxass_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxass_taxass_id_seq OWNER TO admin;

--
-- Name: taxass_taxass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxass_taxass_id_seq OWNED BY taxass.taxass_id;


--
-- Name: taxauth_taxauth_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxauth_taxauth_id_seq OWNER TO admin;

--
-- Name: taxauth_taxauth_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxauth_taxauth_id_seq OWNED BY taxauth.taxauth_id;


--
-- Name: taxclass; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxclass (
    taxclass_id integer NOT NULL,
    taxclass_code text NOT NULL,
    taxclass_descrip text,
    taxclass_sequence integer,
    CONSTRAINT taxclass_taxclass_code_check CHECK ((taxclass_code <> ''::text))
);


ALTER TABLE taxclass OWNER TO admin;

--
-- Name: TABLE taxclass; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxclass IS 'Tax class information';


--
-- Name: COLUMN taxclass.taxclass_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_id IS 'Primary key';


--
-- Name: COLUMN taxclass.taxclass_code; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_code IS 'Code';


--
-- Name: COLUMN taxclass.taxclass_descrip; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_descrip IS 'Description';


--
-- Name: COLUMN taxclass.taxclass_sequence; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxclass.taxclass_sequence IS 'Group sequence';


--
-- Name: taxclass_taxclass_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxclass_taxclass_id_seq OWNER TO admin;

--
-- Name: taxclass_taxclass_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxclass_taxclass_id_seq OWNED BY taxclass.taxclass_id;


--
-- Name: taxhist_taxhist_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxhist_taxhist_id_seq OWNER TO admin;

--
-- Name: taxhist_taxhist_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxhist_taxhist_id_seq OWNED BY taxhist.taxhist_id;


--
-- Name: taxpay; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxpay (
    taxpay_id integer NOT NULL,
    taxpay_taxhist_id integer NOT NULL,
    taxpay_apply_id integer NOT NULL,
    taxpay_distdate date NOT NULL,
    taxpay_tax numeric NOT NULL
);


ALTER TABLE taxpay OWNER TO admin;

--
-- Name: taxpay_taxpay_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxpay_taxpay_id_seq OWNER TO admin;

--
-- Name: taxpay_taxpay_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxpay_taxpay_id_seq OWNED BY taxpay.taxpay_id;


--
-- Name: taxrate; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE taxrate (
    taxrate_id integer NOT NULL,
    taxrate_tax_id integer NOT NULL,
    taxrate_percent numeric(10,6) NOT NULL,
    taxrate_curr_id integer,
    taxrate_amount numeric(16,2) NOT NULL,
    taxrate_effective date,
    taxrate_expires date
);


ALTER TABLE taxrate OWNER TO admin;

--
-- Name: TABLE taxrate; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE taxrate IS 'Tax rates.';


--
-- Name: COLUMN taxrate.taxrate_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_id IS 'Primary key.';


--
-- Name: COLUMN taxrate.taxrate_tax_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_tax_id IS 'The id of the parent tax code.';


--
-- Name: COLUMN taxrate.taxrate_percent; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_percent IS 'Tax rate percentage.';


--
-- Name: COLUMN taxrate.taxrate_curr_id; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_curr_id IS 'The currency id of the flat rate amount.';


--
-- Name: COLUMN taxrate.taxrate_amount; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_amount IS 'Flat tax rate amount.';


--
-- Name: COLUMN taxrate.taxrate_effective; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_effective IS 'The effective date of the tax rate.  NULL value means always.';


--
-- Name: COLUMN taxrate.taxrate_expires; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN taxrate.taxrate_expires IS 'The expire date of the tax rate.  NULL value means never.';


--
-- Name: taxrate_taxrate_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxrate_taxrate_id_seq OWNER TO admin;

--
-- Name: taxrate_taxrate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxrate_taxrate_id_seq OWNED BY taxrate.taxrate_id;


--
-- Name: taxreg_taxreg_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxreg_taxreg_id_seq OWNER TO admin;

--
-- Name: taxreg_taxreg_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxreg_taxreg_id_seq OWNED BY taxreg.taxreg_id;


--
-- Name: taxtype_taxtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxtype_taxtype_id_seq OWNER TO admin;

--
-- Name: taxtype_taxtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxtype_taxtype_id_seq OWNED BY taxtype.taxtype_id;


--
-- Name: taxzone_taxzone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE taxzone_taxzone_id_seq OWNER TO admin;

--
-- Name: taxzone_taxzone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE taxzone_taxzone_id_seq OWNED BY taxzone.taxzone_id;


--
-- Name: terms_terms_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE terms_terms_id_seq OWNER TO admin;

--
-- Name: todoitem_todoitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE todoitem_todoitem_id_seq OWNER TO admin;

--
-- Name: todoitem_todoitem_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE todoitem_todoitem_id_seq OWNED BY todoitem.todoitem_id;


--
-- Name: trgthist; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE trgthist (
    trgthist_src_cntct_id integer NOT NULL,
    trgthist_trgt_cntct_id integer NOT NULL,
    trgthist_col text NOT NULL,
    trgthist_value text NOT NULL
);


ALTER TABLE trgthist OWNER TO admin;

--
-- Name: trialbal; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE trialbal (
    trialbal_id integer NOT NULL,
    trialbal_period_id integer,
    trialbal_accnt_id integer,
    trialbal_beginning numeric(20,2),
    trialbal_ending numeric(20,2),
    trialbal_credits numeric(20,2),
    trialbal_debits numeric(20,2),
    trialbal_dirty boolean,
    trialbal_yearend numeric(20,2) DEFAULT 0.00 NOT NULL
);


ALTER TABLE trialbal OWNER TO admin;

--
-- Name: TABLE trialbal; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE trialbal IS 'Trial Balance information';


--
-- Name: trialbal_trialbal_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE trialbal_trialbal_id_seq OWNER TO admin;

--
-- Name: trialbal_trialbal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE trialbal_trialbal_id_seq OWNED BY trialbal.trialbal_id;


--
-- Name: uom_uom_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE uom_uom_id_seq OWNER TO admin;

--
-- Name: uom_uom_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uom_uom_id_seq OWNED BY uom.uom_id;


--
-- Name: uomconv; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE uomconv (
    uomconv_id integer NOT NULL,
    uomconv_from_uom_id integer NOT NULL,
    uomconv_from_value numeric(20,10) NOT NULL,
    uomconv_to_uom_id integer NOT NULL,
    uomconv_to_value numeric(20,10) NOT NULL,
    uomconv_fractional boolean DEFAULT false NOT NULL
);


ALTER TABLE uomconv OWNER TO admin;

--
-- Name: TABLE uomconv; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE uomconv IS 'UOM conversion information. From Unit to To Unit with a value per ratio.';


--
-- Name: uomconv_uomconv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE uomconv_uomconv_id_seq OWNER TO admin;

--
-- Name: uomconv_uomconv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uomconv_uomconv_id_seq OWNED BY uomconv.uomconv_id;


--
-- Name: uomtype; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE uomtype (
    uomtype_id integer NOT NULL,
    uomtype_name text NOT NULL,
    uomtype_descrip text,
    uomtype_multiple boolean DEFAULT false NOT NULL,
    CONSTRAINT uomtype_uomtype_name_check CHECK ((uomtype_name <> ''::text))
);


ALTER TABLE uomtype OWNER TO admin;

--
-- Name: TABLE uomtype; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE uomtype IS 'UOM Type values.';


--
-- Name: uomtype_uomtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE uomtype_uomtype_id_seq OWNER TO admin;

--
-- Name: uomtype_uomtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE uomtype_uomtype_id_seq OWNED BY uomtype.uomtype_id;


--
-- Name: urlinfo_url_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE urlinfo_url_id_seq OWNER TO admin;

--
-- Name: urlinfo_url_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE urlinfo_url_id_seq OWNED BY urlinfo.url_id;


--
-- Name: usrpref; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usrpref (
    usrpref_id integer DEFAULT nextval(('usrpref_usrpref_id_seq'::text)::regclass) NOT NULL,
    usrpref_name text,
    usrpref_value text,
    usrpref_username text
);


ALTER TABLE usrpref OWNER TO admin;

--
-- Name: TABLE usrpref; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usrpref IS 'User Preferences information';


--
-- Name: usr; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW usr AS
    SELECT (pg_user.usesysid)::integer AS usr_id, (pg_user.usename)::text AS usr_username, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'propername'::text))), ''::text) AS usr_propername, NULL::text AS usr_passwd, COALESCE((SELECT (usrpref.usrpref_value)::integer AS usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'locale_id'::text))), COALESCE((SELECT locale.locale_id FROM locale WHERE (lower(locale.locale_code) = 'default'::text) LIMIT 1), (SELECT locale.locale_id FROM locale ORDER BY locale.locale_id LIMIT 1))) AS usr_locale_id, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'initials'::text))), ''::text) AS usr_initials, COALESCE((SELECT CASE WHEN (usrpref.usrpref_value = 't'::text) THEN true ELSE false END AS "case" FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'agent'::text))), false) AS usr_agent, COALESCE((SELECT CASE WHEN (usrpref.usrpref_value = 't'::text) THEN true ELSE false END AS "case" FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'active'::text))), usercanlogin((pg_user.usename)::text)) AS usr_active, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'email'::text))), ''::text) AS usr_email, COALESCE((SELECT usrpref.usrpref_value FROM usrpref WHERE ((usrpref.usrpref_username = (pg_user.usename)::text) AND (usrpref.usrpref_name = 'window'::text))), ''::text) AS usr_window FROM pg_user;


ALTER TABLE usr OWNER TO admin;

--
-- Name: usr_bak; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE usr_bak (
    usr_id integer DEFAULT nextval(('usr_usr_id_seq'::text)::regclass) NOT NULL,
    usr_username text NOT NULL,
    usr_propername text,
    usr_passwd text,
    usr_locale_id integer NOT NULL,
    usr_initials text,
    usr_agent boolean NOT NULL,
    usr_active boolean NOT NULL,
    usr_email text,
    usr_window text
);


ALTER TABLE usr_bak OWNER TO admin;

--
-- Name: TABLE usr_bak; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE usr_bak IS 'User information';


--
-- Name: usr_usr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE usr_usr_id_seq OWNER TO admin;

--
-- Name: usrgrp_usrgrp_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE usrgrp_usrgrp_id_seq OWNER TO admin;

--
-- Name: usrgrp_usrgrp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE usrgrp_usrgrp_id_seq OWNED BY usrgrp.usrgrp_id;


--
-- Name: usrpref_usrpref_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE usrpref_usrpref_id_seq OWNER TO admin;

--
-- Name: usrpriv_usrpriv_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE usrpriv_usrpriv_id_seq OWNER TO admin;

--
-- Name: vend; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW vend AS
    SELECT vendinfo.vend_id, vendinfo.vend_name, m.addr_line1 AS vend_address1, m.addr_line2 AS vend_address2, m.addr_line3 AS vend_address3, m.addr_city AS vend_city, m.addr_state AS vend_state, m.addr_postalcode AS vend_zip, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS vend_contact1, c1.cntct_phone AS vend_phone1, btrim(((c2.cntct_first_name || ' '::text) || c2.cntct_last_name)) AS vend_contact2, c2.cntct_phone AS vend_phone2, vendinfo.vend_lastpurchdate, vendinfo.vend_active, vendinfo.vend_po, vendinfo.vend_comments, vendinfo.vend_pocomments, vendinfo.vend_number, c1.cntct_fax AS vend_fax1, c2.cntct_fax AS vend_fax2, c1.cntct_email AS vend_email1, c2.cntct_email AS vend_email2, vendinfo.vend_1099, vendinfo.vend_exported, vendinfo.vend_fobsource, vendinfo.vend_fob, vendinfo.vend_terms_id, vendinfo.vend_shipvia, vendinfo.vend_vendtype_id, vendinfo.vend_qualified, vendinfo.vend_ediemail, vendinfo.vend_ediemailbody, vendinfo.vend_edisubject, vendinfo.vend_edifilename, vendinfo.vend_accntnum, vendinfo.vend_emailpodelivery, vendinfo.vend_restrictpurch, vendinfo.vend_edicc, m.addr_country AS vend_country, vendinfo.vend_curr_id, vendinfo.vend_taxzone_id FROM (((vendinfo LEFT JOIN cntct c1 ON ((vendinfo.vend_cntct1_id = c1.cntct_id))) LEFT JOIN addr m ON ((vendinfo.vend_addr_id = m.addr_id))) LEFT JOIN cntct c2 ON ((vendinfo.vend_cntct2_id = c2.cntct_id)));


ALTER TABLE vend OWNER TO admin;

--
-- Name: vend_vend_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE vend_vend_id_seq OWNER TO admin;

--
-- Name: vendaddr; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW vendaddr AS
    SELECT vendaddrinfo.vendaddr_id, vendaddrinfo.vendaddr_vend_id, vendaddrinfo.vendaddr_code, vendaddrinfo.vendaddr_name, m.addr_line1 AS vendaddr_address1, m.addr_line2 AS vendaddr_address2, m.addr_line3 AS vendaddr_address3, btrim(((c1.cntct_first_name || ' '::text) || c1.cntct_last_name)) AS vendaddr_contact1, c1.cntct_phone AS vendaddr_phone1, c1.cntct_fax AS vendaddr_fax1, m.addr_city AS vendaddr_city, m.addr_state AS vendaddr_state, m.addr_postalcode AS vendaddr_zipcode, m.addr_country AS vendaddr_country FROM ((vendaddrinfo LEFT JOIN cntct c1 ON ((vendaddrinfo.vendaddr_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((vendaddrinfo.vendaddr_addr_id = m.addr_id)));


ALTER TABLE vendaddr OWNER TO admin;

--
-- Name: vendaddr_vendaddr_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE vendaddr_vendaddr_id_seq OWNER TO admin;

--
-- Name: vendtype_vendtype_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE vendtype_vendtype_id_seq OWNER TO admin;

--
-- Name: vendtype_vendtype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE vendtype_vendtype_id_seq OWNED BY vendtype.vendtype_id;


--
-- Name: vodist; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE vodist (
    vodist_id integer DEFAULT nextval(('"vodist_vodist_id_seq"'::text)::regclass) NOT NULL,
    vodist_poitem_id integer,
    vodist_vohead_id integer,
    vodist_costelem_id integer,
    vodist_accnt_id integer,
    vodist_amount numeric(18,6),
    vodist_qty numeric(18,6),
    vodist_expcat_id integer DEFAULT (-1),
    vodist_tax_id integer DEFAULT (-1),
    vodist_discountable boolean DEFAULT true NOT NULL,
    vodist_notes text
);


ALTER TABLE vodist OWNER TO admin;

--
-- Name: TABLE vodist; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE vodist IS 'Voucher distribution information';


--
-- Name: vodist_vodist_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE vodist_vodist_id_seq OWNER TO admin;

--
-- Name: vohead; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE vohead (
    vohead_id integer DEFAULT nextval(('vohead_vohead_id_seq'::text)::regclass) NOT NULL,
    vohead_number text NOT NULL,
    vohead_pohead_id integer,
    vohead_posted boolean,
    vohead_duedate date,
    vohead_invcnumber text,
    vohead_amount numeric(16,4),
    vohead_docdate date,
    vohead_1099 boolean,
    vohead_distdate date,
    vohead_reference text,
    vohead_terms_id integer,
    vohead_vend_id integer,
    vohead_curr_id integer DEFAULT basecurrid(),
    vohead_adjtaxtype_id integer,
    vohead_freighttaxtype_id integer,
    vohead_gldistdate date,
    vohead_misc boolean,
    vohead_taxzone_id integer,
    vohead_taxtype_id integer,
    vohead_notes text,
    vohead_recurring_vohead_id integer,
    CONSTRAINT vohead_vohead_number_check CHECK ((vohead_number <> ''::text))
);


ALTER TABLE vohead OWNER TO admin;

--
-- Name: TABLE vohead; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE vohead IS 'Voucher header information';


--
-- Name: vohead_vohead_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE vohead_vohead_id_seq OWNER TO admin;

--
-- Name: voheadtax; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voheadtax (
)
INHERITS (taxhist);


ALTER TABLE voheadtax OWNER TO admin;

--
-- Name: voitem; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voitem (
    voitem_id integer DEFAULT nextval(('"voitem_voitem_id_seq"'::text)::regclass) NOT NULL,
    voitem_vohead_id integer,
    voitem_poitem_id integer,
    voitem_close boolean,
    voitem_qty numeric(18,6),
    voitem_freight numeric(16,4) DEFAULT 0.0 NOT NULL,
    voitem_taxtype_id integer
);


ALTER TABLE voitem OWNER TO admin;

--
-- Name: TABLE voitem; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE voitem IS 'Voucher Line Item information';


--
-- Name: voitem_voitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE voitem_voitem_id_seq OWNER TO admin;

--
-- Name: voitemtax; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE voitemtax (
)
INHERITS (taxhist);


ALTER TABLE voitemtax OWNER TO admin;

--
-- Name: warehous; Type: VIEW; Schema: public; Owner: admin
--

CREATE VIEW warehous AS
    SELECT whsinfo.warehous_id, whsinfo.warehous_code, whsinfo.warehous_descrip, m.addr_line1 AS warehous_addr1, m.addr_line2 AS warehous_addr2, m.addr_line3 AS warehous_addr3, m.addr_city AS warehous_addr4, m.addr_city AS warehous_city, m.addr_state AS warehous_state, m.addr_postalcode AS warehous_zip, m.addr_country AS warehous_country, whsinfo.warehous_fob, whsinfo.warehous_active, whsinfo.warehous_sitetype_id, whsinfo.warehous_counttag_prefix, whsinfo.warehous_counttag_number, whsinfo.warehous_bol_prefix, whsinfo.warehous_bol_number, whsinfo.warehous_shipping, whsinfo.warehous_useslips, whsinfo.warehous_usezones, whsinfo.warehous_aislesize, whsinfo.warehous_aislealpha, whsinfo.warehous_racksize, whsinfo.warehous_rackalpha, whsinfo.warehous_binsize, whsinfo.warehous_binalpha, whsinfo.warehous_locationsize, whsinfo.warehous_locationalpha, whsinfo.warehous_enforcearbl, whsinfo.warehous_default_accnt_id, whsinfo.warehous_shipping_commission FROM ((whsinfo LEFT JOIN cntct c1 ON ((whsinfo.warehous_cntct_id = c1.cntct_id))) LEFT JOIN addr m ON ((whsinfo.warehous_addr_id = m.addr_id)));


ALTER TABLE warehous OWNER TO admin;

--
-- Name: warehous_warehous_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE warehous_warehous_id_seq OWNER TO admin;

--
-- Name: whsezone_whsezone_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE whsezone_whsezone_id_seq OWNER TO admin;

--
-- Name: whsezone_whsezone_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE whsezone_whsezone_id_seq OWNED BY whsezone.whsezone_id;


--
-- Name: wo; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE wo (
    wo_id integer DEFAULT nextval(('wo_wo_id_seq'::text)::regclass) NOT NULL,
    wo_number integer,
    wo_subnumber integer,
    wo_status character(1),
    wo_itemsite_id integer,
    wo_startdate date,
    wo_duedate date,
    wo_ordtype character(1),
    wo_ordid integer,
    wo_qtyord numeric(18,6),
    wo_qtyrcv numeric(18,6),
    wo_adhoc boolean,
    wo_itemcfg_series integer,
    wo_imported boolean,
    wo_wipvalue numeric(16,6) DEFAULT 0,
    wo_postedvalue numeric(16,6) DEFAULT 0,
    wo_prodnotes text,
    wo_prj_id integer,
    wo_priority integer DEFAULT 1 NOT NULL,
    wo_brdvalue numeric(16,6) DEFAULT 0,
    wo_bom_rev_id integer DEFAULT (-1),
    wo_boo_rev_id integer DEFAULT (-1),
    wo_cosmethod character(1),
    wo_womatl_id integer,
    wo_username text DEFAULT geteffectivextuser(),
    CONSTRAINT chk_wo_cosmethod CHECK ((((wo_cosmethod = NULL::bpchar) OR (wo_cosmethod = 'D'::bpchar)) OR (wo_cosmethod = 'P'::bpchar)))
);


ALTER TABLE wo OWNER TO admin;

--
-- Name: TABLE wo; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE wo IS 'Work Order information';


--
-- Name: wo_wo_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE wo_wo_id_seq OWNER TO admin;

--
-- Name: womatl_womatl_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE womatl_womatl_id_seq OWNER TO admin;

--
-- Name: womatlpost; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE womatlpost (
    womatlpost_id integer NOT NULL,
    womatlpost_womatl_id integer,
    womatlpost_invhist_id integer
);


ALTER TABLE womatlpost OWNER TO admin;

--
-- Name: TABLE womatlpost; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE womatlpost IS 'Table to tie work order to work order material transactions for efficient queries';


--
-- Name: womatlpost_womatlpost_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE womatlpost_womatlpost_id_seq OWNER TO admin;

--
-- Name: womatlpost_womatlpost_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE womatlpost_womatlpost_id_seq OWNED BY womatlpost.womatlpost_id;


--
-- Name: womatlvar; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE womatlvar (
    womatlvar_id integer DEFAULT nextval(('"womatlvar_womatlvar_id_seq"'::text)::regclass) NOT NULL,
    womatlvar_number integer,
    womatlvar_subnumber integer,
    womatlvar_posted date,
    womatlvar_parent_itemsite_id integer,
    womatlvar_component_itemsite_id integer,
    womatlvar_qtyord numeric(18,6),
    womatlvar_qtyrcv numeric(18,6),
    womatlvar_qtyiss numeric(18,6),
    womatlvar_qtyper numeric(18,6),
    womatlvar_scrap numeric(18,6),
    womatlvar_wipscrap numeric(18,6),
    womatlvar_bomitem_id integer,
    womatlvar_ref text,
    womatlvar_notes text,
    womatlvar_qtyfxd numeric(20,8) DEFAULT 0 NOT NULL
);


ALTER TABLE womatlvar OWNER TO admin;

--
-- Name: TABLE womatlvar; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE womatlvar IS 'Work Order Material Requirements Variance information';


--
-- Name: COLUMN womatlvar.womatlvar_qtyfxd; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON COLUMN womatlvar.womatlvar_qtyfxd IS 'The fixed quantity required';


--
-- Name: womatlvar_womatlvar_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE womatlvar_womatlvar_id_seq OWNER TO admin;

--
-- Name: xcalitem_xcalitem_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE xcalitem_xcalitem_id_seq OWNER TO admin;

--
-- Name: xsltmap; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE xsltmap (
    xsltmap_id integer NOT NULL,
    xsltmap_name text NOT NULL,
    xsltmap_doctype text NOT NULL,
    xsltmap_system text NOT NULL,
    xsltmap_import text NOT NULL,
    xsltmap_export text DEFAULT ''::text NOT NULL,
    CONSTRAINT xsltmap_check CHECK (((xsltmap_doctype <> ''::text) OR (xsltmap_system <> ''::text))),
    CONSTRAINT xsltmap_xsltmap_importexport_check CHECK (((xsltmap_import <> ''::text) OR (xsltmap_export <> ''::text))),
    CONSTRAINT xsltmap_xsltmap_name_check CHECK ((xsltmap_name <> ''::text))
);


ALTER TABLE xsltmap OWNER TO admin;

--
-- Name: TABLE xsltmap; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE xsltmap IS 'Mapping of XML System identifiers to XSLT transformation files';


--
-- Name: xsltmap_xsltmap_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE xsltmap_xsltmap_id_seq OWNER TO admin;

--
-- Name: xsltmap_xsltmap_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE xsltmap_xsltmap_id_seq OWNED BY xsltmap.xsltmap_id;


--
-- Name: yearperiod; Type: TABLE; Schema: public; Owner: admin; Tablespace: 
--

CREATE TABLE yearperiod (
    yearperiod_id integer NOT NULL,
    yearperiod_start date NOT NULL,
    yearperiod_end date NOT NULL,
    yearperiod_closed boolean DEFAULT false NOT NULL
);


ALTER TABLE yearperiod OWNER TO admin;

--
-- Name: TABLE yearperiod; Type: COMMENT; Schema: public; Owner: admin
--

COMMENT ON TABLE yearperiod IS 'Accounting Year Periods information';


--
-- Name: yearperiod_yearperiod_id_seq; Type: SEQUENCE; Schema: public; Owner: admin
--

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


ALTER TABLE yearperiod_yearperiod_id_seq OWNER TO admin;

--
-- Name: yearperiod_yearperiod_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: admin
--

ALTER SEQUENCE yearperiod_yearperiod_id_seq OWNED BY yearperiod.yearperiod_id;



--
-- Name: pkgcmd; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmd (
    cmd_id integer DEFAULT nextval('public.cmd_cmd_id_seq'::regclass)
)
INHERITS (public.cmd);


ALTER TABLE pkgcmd OWNER TO admin;

--
-- Name: pkgcmdarg; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmdarg (
    cmdarg_id integer DEFAULT nextval('public.cmdarg_cmdarg_id_seq'::regclass)
)
INHERITS (public.cmdarg);


ALTER TABLE pkgcmdarg OWNER TO admin;

--
-- Name: pkgimage; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgimage (
    image_id integer DEFAULT nextval('public.image_image_id_seq'::regclass)
)
INHERITS (public.image);


ALTER TABLE pkgimage OWNER TO admin;

--
-- Name: pkgmetasql; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgmetasql (
    metasql_id integer DEFAULT nextval('public.metasql_metasql_id_seq'::regclass)
)
INHERITS (public.metasql);


ALTER TABLE pkgmetasql OWNER TO admin;

--
-- Name: pkgpriv; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgpriv (
    priv_id integer DEFAULT nextval('public.priv_priv_id_seq'::regclass)
)
INHERITS (public.priv);


ALTER TABLE pkgpriv OWNER TO admin;

--
-- Name: pkgreport; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgreport (
    report_id integer DEFAULT nextval('public.report_report_id_seq'::regclass)
)
INHERITS (public.report);


ALTER TABLE pkgreport OWNER TO admin;

--
-- Name: pkgscript; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkgscript (
    script_id integer DEFAULT nextval('public.script_script_id_seq'::regclass)
)
INHERITS (public.script);


ALTER TABLE pkgscript OWNER TO admin;

--
-- Name: pkguiform; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE pkguiform (
    uiform_id integer DEFAULT nextval('public.uiform_uiform_id_seq'::regclass)
)
INHERITS (public.uiform);


ALTER TABLE pkguiform OWNER TO admin;

--
-- Name: tecustrate; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE tecustrate (
    tecustrate_cust_id integer NOT NULL,
    tecustrate_rate numeric(16,4) NOT NULL,
    tecustrate_id integer NOT NULL,
    tecustrate_curr_id integer DEFAULT public.basecurrid() NOT NULL
);


ALTER TABLE tecustrate OWNER TO admin;

--
-- Name: TABLE tecustrate; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE tecustrate IS 'Customer rate';


--
-- Name: tecustrate_tecustrate_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE tecustrate_tecustrate_id_seq OWNER TO admin;

--
-- Name: tecustrate_tecustrate_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE tecustrate_tecustrate_id_seq OWNED BY tecustrate.tecustrate_id;


--
-- Name: teemp; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teemp (
    teemp_id integer NOT NULL,
    teemp_emp_id integer,
    teemp_contractor boolean DEFAULT false
);


ALTER TABLE teemp OWNER TO admin;

--
-- Name: TABLE teemp; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teemp IS 'Time Expense Employee';


--
-- Name: teemp_teemp_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE teemp_teemp_id_seq OWNER TO admin;

--
-- Name: teemp_teemp_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teemp_teemp_id_seq OWNED BY teemp.teemp_id;


--
-- Name: teexp; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teexp (
    teexp_id integer NOT NULL,
    teexp_expcat_id integer,
    teexp_accnt_id integer
);


ALTER TABLE teexp OWNER TO admin;

--
-- Name: TABLE teexp; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teexp IS 'Time Expense Item Master';


--
-- Name: timesheet_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE timesheet_seq OWNER TO admin;

--
-- Name: tehead; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE tehead (
    tehead_id integer NOT NULL,
    tehead_number text DEFAULT nextval('timesheet_seq'::regclass),
    tehead_weekending date,
    tehead_lastupdated timestamp without time zone DEFAULT now() NOT NULL,
    tehead_notes text,
    tehead_status character(1) DEFAULT 'O'::bpchar NOT NULL,
    tehead_emp_id integer,
    tehead_warehous_id integer NOT NULL,
    tehead_username text DEFAULT public.geteffectivextuser() NOT NULL,
    CONSTRAINT tehead_tehead_status_check CHECK ((tehead_status = ANY (ARRAY['O'::bpchar, 'A'::bpchar, 'C'::bpchar])))
);


ALTER TABLE tehead OWNER TO admin;

--
-- Name: TABLE tehead; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE tehead IS 'Time/Expense Worksheet Header';


--
-- Name: tehead_tehead_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE tehead_tehead_id_seq OWNER TO admin;

--
-- Name: tehead_tehead_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE tehead_tehead_id_seq OWNED BY tehead.tehead_id;


--
-- Name: teitem; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teitem (
    teitem_id integer NOT NULL,
    teitem_tehead_id integer,
    teitem_linenumber integer NOT NULL,
    teitem_type character(1) NOT NULL,
    teitem_workdate date,
    teitem_cust_id integer,
    teitem_vend_id integer,
    teitem_po text,
    teitem_item_id integer NOT NULL,
    teitem_qty numeric NOT NULL,
    teitem_rate numeric NOT NULL,
    teitem_total numeric NOT NULL,
    teitem_prjtask_id integer,
    teitem_lastupdated timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
    teitem_billable boolean,
    teitem_prepaid boolean,
    teitem_notes text,
    teitem_posted boolean DEFAULT false,
    teitem_curr_id integer DEFAULT public.basecurrid() NOT NULL,
    teitem_uom_id integer,
    teitem_invcitem_id integer,
    teitem_vodist_id integer,
    teitem_postedvalue numeric DEFAULT 0 NOT NULL,
    teitem_empcost numeric
);


ALTER TABLE teitem OWNER TO admin;

--
-- Name: TABLE teitem; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teitem IS 'Time Expense Worksheet Item';


--
-- Name: COLUMN teitem.teitem_type; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_type IS 'T or E';


--
-- Name: COLUMN teitem.teitem_vend_id; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_vend_id IS 'future use - for payment of vendor for expenses';


--
-- Name: COLUMN teitem.teitem_prepaid; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON COLUMN teitem.teitem_prepaid IS 'Used for expenses only.  CC paid expenses would be prepaid.';


--
-- Name: teitem_teitem_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE teitem_teitem_id_seq OWNER TO admin;

--
-- Name: teitem_teitem_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teitem_teitem_id_seq OWNED BY teitem.teitem_id;


--
-- Name: teprj; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teprj (
    teprj_id integer NOT NULL,
    teprj_prj_id integer,
    teprj_cust_id integer,
    teprj_rate numeric,
    teprj_curr_id integer
);


ALTER TABLE teprj OWNER TO admin;

--
-- Name: TABLE teprj; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teprj IS 'Time/Expense Information for Projects';


--
-- Name: teprj_teprj_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE teprj_teprj_id_seq OWNER TO admin;

--
-- Name: teprj_teprj_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teprj_teprj_id_seq OWNED BY teprj.teprj_id;


--
-- Name: teprjtask; Type: TABLE; Schema: te; Owner: admin; Tablespace: 
--

CREATE TABLE teprjtask (
    teprjtask_id integer NOT NULL,
    teprjtask_cust_id integer,
    teprjtask_rate numeric,
    teprjtask_item_id integer,
    teprjtask_prjtask_id integer NOT NULL,
    teprjtask_curr_id integer DEFAULT public.basecurrid()
);


ALTER TABLE teprjtask OWNER TO admin;

--
-- Name: TABLE teprjtask; Type: COMMENT; Schema: te; Owner: admin
--

COMMENT ON TABLE teprjtask IS 'Time Expense Project Task';


--
-- Name: teprjtask_teprjtask_id_seq; Type: SEQUENCE; Schema: te; Owner: admin
--

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


ALTER TABLE teprjtask_teprjtask_id_seq OWNER TO admin;

--
-- Name: teprjtask_teprjtask_id_seq; Type: SEQUENCE OWNED BY; Schema: te; Owner: admin
--

ALTER SEQUENCE teprjtask_teprjtask_id_seq OWNED BY teprjtask.teprjtask_id;



--
-- Name: js; Type: TABLE; Schema: xt; Owner: admin; Tablespace: 
--

CREATE TABLE js (
    js_id integer NOT NULL,
    js_text text NOT NULL,
    js_namespace text NOT NULL,
    js_type text NOT NULL,
    js_context text NOT NULL,
    js_ext boolean DEFAULT false NOT NULL,
    js_active boolean DEFAULT true NOT NULL
);


ALTER TABLE js OWNER TO admin;

--
-- Name: TABLE js; Type: COMMENT; Schema: xt; Owner: admin
--

COMMENT ON TABLE js IS 'Core table for xTuple JavaScript Objects Reference';


--
-- Name: js_js_id_seq; Type: SEQUENCE; Schema: xt; Owner: admin
--

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


ALTER TABLE js_js_id_seq OWNER TO admin;

--
-- Name: js_js_id_seq; Type: SEQUENCE OWNED BY; Schema: xt; Owner: admin
--

ALTER SEQUENCE js_js_id_seq OWNED BY js.js_id;



--
-- Name: pkgcmd; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmd (
    cmd_id integer DEFAULT nextval('public.cmd_cmd_id_seq'::regclass)
)
INHERITS (public.cmd);


ALTER TABLE pkgcmd OWNER TO admin;

--
-- Name: pkgcmdarg; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgcmdarg (
    cmdarg_id integer DEFAULT nextval('public.cmdarg_cmdarg_id_seq'::regclass)
)
INHERITS (public.cmdarg);


ALTER TABLE pkgcmdarg OWNER TO admin;

--
-- Name: pkgimage; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgimage (
    image_id integer DEFAULT nextval('public.image_image_id_seq'::regclass)
)
INHERITS (public.image);


ALTER TABLE pkgimage OWNER TO admin;

--
-- Name: pkgmetasql; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgmetasql (
    metasql_id integer DEFAULT nextval('public.metasql_metasql_id_seq'::regclass)
)
INHERITS (public.metasql);


ALTER TABLE pkgmetasql OWNER TO admin;

--
-- Name: pkgpriv; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgpriv (
    priv_id integer DEFAULT nextval('public.priv_priv_id_seq'::regclass)
)
INHERITS (public.priv);


ALTER TABLE pkgpriv OWNER TO admin;

--
-- Name: pkgreport; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgreport (
    report_id integer DEFAULT nextval('public.report_report_id_seq'::regclass)
)
INHERITS (public.report);


ALTER TABLE pkgreport OWNER TO admin;

--
-- Name: pkgscript; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkgscript (
    script_id integer DEFAULT nextval('public.script_script_id_seq'::regclass)
)
INHERITS (public.script);


ALTER TABLE pkgscript OWNER TO admin;

--
-- Name: pkguiform; Type: TABLE; Schema: xtdesktop; Owner: admin; Tablespace: 
--

CREATE TABLE pkguiform (
    uiform_id integer DEFAULT nextval('public.uiform_uiform_id_seq'::regclass)
)
INHERITS (public.uiform);


ALTER TABLE pkguiform OWNER TO admin;


--
-- Name: metasql_grade; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- Name: script_enabled; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- Name: uiform_enabled; Type: DEFAULT; Schema: fixcountry; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;



--
-- Name: addr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY addr ALTER COLUMN addr_id SET DEFAULT nextval('addr_addr_id_seq'::regclass);


--
-- Name: alarm_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY alarm ALTER COLUMN alarm_id SET DEFAULT nextval('alarm_alarm_id_seq'::regclass);


--
-- Name: apaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apaccnt ALTER COLUMN apaccnt_id SET DEFAULT nextval('apaccnt_apaccnt_id_seq'::regclass);


--
-- Name: apapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apapply ALTER COLUMN apapply_id SET DEFAULT nextval('apapply_apapply_id_seq'::regclass);


--
-- Name: apcreditapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apcreditapply ALTER COLUMN apcreditapply_id SET DEFAULT nextval('apcreditapply_apcreditapply_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apopentax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: apselect_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY apselect ALTER COLUMN apselect_id SET DEFAULT nextval('apselect_apselect_id_seq'::regclass);


--
-- Name: arapply_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY arapply ALTER COLUMN arapply_id SET DEFAULT nextval('arapply_arapply_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY aropentax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: asohist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohist ALTER COLUMN asohist_id SET DEFAULT nextval('asohist_asohist_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY asohisttax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: atlasmap_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY atlasmap ALTER COLUMN atlasmap_id SET DEFAULT nextval('atlasmap_atlasmap_id_seq'::regclass);


--
-- Name: bankaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankaccnt ALTER COLUMN bankaccnt_id SET DEFAULT nextval('bankaccnt_bankaccnt_id_seq'::regclass);


--
-- Name: bankadj_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankadj ALTER COLUMN bankadj_id SET DEFAULT nextval('bankadj_bankadj_id_seq'::regclass);


--
-- Name: bankadjtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankadjtype ALTER COLUMN bankadjtype_id SET DEFAULT nextval('bankadjtype_bankadjtype_id_seq'::regclass);


--
-- Name: bankrec_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankrec ALTER COLUMN bankrec_id SET DEFAULT nextval('bankrec_bankrec_id_seq'::regclass);


--
-- Name: bankrecimport_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankrecimport ALTER COLUMN bankrecimport_id SET DEFAULT nextval('bankrecimport_bankrecimport_id_seq'::regclass);


--
-- Name: bankrecitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bankrecitem ALTER COLUMN bankrecitem_id SET DEFAULT nextval('bankrecitem_bankrecitem_id_seq'::regclass);


--
-- Name: bomitemcost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemcost ALTER COLUMN bomitemcost_id SET DEFAULT nextval('bomitemcost_bomitemcost_id_seq'::regclass);


--
-- Name: bomitemsub_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomitemsub ALTER COLUMN bomitemsub_id SET DEFAULT nextval('bomitemsub_bomitemsub_id_seq'::regclass);


--
-- Name: bomwork_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY bomwork ALTER COLUMN bomwork_id SET DEFAULT nextval('bomwork_bomwork_id_seq'::regclass);


--
-- Name: budghead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budghead ALTER COLUMN budghead_id SET DEFAULT nextval('budghead_budghead_id_seq'::regclass);


--
-- Name: budgitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY budgitem ALTER COLUMN budgitem_id SET DEFAULT nextval('budgitem_budgitem_id_seq'::regclass);


--
-- Name: cashrcpt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcpt ALTER COLUMN cashrcpt_id SET DEFAULT nextval('cashrcpt_cashrcpt_id_seq'::regclass);


--
-- Name: cashrcptitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptitem ALTER COLUMN cashrcptitem_id SET DEFAULT nextval('cashrcptitem_cashrcptitem_id_seq'::regclass);


--
-- Name: cashrcptmisc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cashrcptmisc ALTER COLUMN cashrcptmisc_id SET DEFAULT nextval('cashrcptmisc_cashrcptmisc_id_seq'::regclass);


--
-- Name: ccard_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccard ALTER COLUMN ccard_id SET DEFAULT nextval('ccard_ccard_id_seq'::regclass);


--
-- Name: ccardaud_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccardaud ALTER COLUMN ccardaud_id SET DEFAULT nextval('ccardaud_ccardaud_id_seq'::regclass);


--
-- Name: ccbank_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccbank ALTER COLUMN ccbank_id SET DEFAULT nextval('ccbank_ccbank_id_seq'::regclass);


--
-- Name: ccpay_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ccpay ALTER COLUMN ccpay_id SET DEFAULT nextval('ccpay_ccpay_id_seq'::regclass);


--
-- Name: char_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY "char" ALTER COLUMN char_id SET DEFAULT nextval('char_char_id_seq'::regclass);


--
-- Name: charass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charass ALTER COLUMN charass_id SET DEFAULT nextval('charass_charass_id_seq'::regclass);


--
-- Name: charopt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charopt ALTER COLUMN charopt_id SET DEFAULT nextval('charopt_charopt_id_seq'::regclass);


--
-- Name: charuse_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY charuse ALTER COLUMN charuse_id SET DEFAULT nextval('charuse_charuse_id_seq'::regclass);


--
-- Name: checkhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkhead ALTER COLUMN checkhead_id SET DEFAULT nextval('checkhead_checkhead_id_seq'::regclass);


--
-- Name: checkitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY checkitem ALTER COLUMN checkitem_id SET DEFAULT nextval('checkitem_checkitem_id_seq'::regclass);


--
-- Name: cmd_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmd ALTER COLUMN cmd_id SET DEFAULT nextval('cmd_cmd_id_seq'::regclass);


--
-- Name: cmdarg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmdarg ALTER COLUMN cmdarg_id SET DEFAULT nextval('cmdarg_cmdarg_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: cmnttype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttype ALTER COLUMN cmnttype_id SET DEFAULT nextval('cmnttype_cmnttype_id_seq'::regclass);


--
-- Name: cmnttypesource_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cmnttypesource ALTER COLUMN cmnttypesource_id SET DEFAULT nextval('cmnttypesource_cmnttypesource_id_seq'::regclass);


--
-- Name: cntct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntct ALTER COLUMN cntct_id SET DEFAULT nextval('cntct_cntct_id_seq'::regclass);


--
-- Name: cntctaddr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctaddr ALTER COLUMN cntctaddr_id SET DEFAULT nextval('cntctaddr_cntctaddr_id_seq'::regclass);


--
-- Name: cntctdata_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntctdata ALTER COLUMN cntctdata_id SET DEFAULT nextval('cntctdata_cntctdata_id_seq'::regclass);


--
-- Name: cntcteml_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cntcteml ALTER COLUMN cntcteml_id SET DEFAULT nextval('cntcteml_cntcteml_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobilltax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cobmisctax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY cohisttax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: company_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY company ALTER COLUMN company_id SET DEFAULT nextval('company_company_id_seq'::regclass);


--
-- Name: contrct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY contrct ALTER COLUMN contrct_id SET DEFAULT nextval('contrct_contrct_id_seq'::regclass);


--
-- Name: country_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY country ALTER COLUMN country_id SET DEFAULT nextval('country_country_id_seq'::regclass);


--
-- Name: crmacct_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY crmacct ALTER COLUMN crmacct_id SET DEFAULT nextval('crmacct_crmacct_id_seq'::regclass);


--
-- Name: curr_rate_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY curr_rate ALTER COLUMN curr_rate_id SET DEFAULT nextval('curr_rate_curr_rate_id_seq'::regclass);


--
-- Name: curr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY curr_symbol ALTER COLUMN curr_id SET DEFAULT nextval('curr_symbol_curr_id_seq'::regclass);


--
-- Name: dept_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY dept ALTER COLUMN dept_id SET DEFAULT nextval('dept_dept_id_seq'::regclass);


--
-- Name: docass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY docass ALTER COLUMN docass_id SET DEFAULT nextval('docass_docass_id_seq'::regclass);


--
-- Name: emp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY emp ALTER COLUMN emp_id SET DEFAULT nextval('emp_emp_id_seq'::regclass);


--
-- Name: empgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrp ALTER COLUMN empgrp_id SET DEFAULT nextval('empgrp_empgrp_id_seq'::regclass);


--
-- Name: empgrpitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY empgrpitem ALTER COLUMN empgrpitem_id SET DEFAULT nextval('empgrpitem_empgrpitem_id_seq'::regclass);


--
-- Name: expcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY expcat ALTER COLUMN expcat_id SET DEFAULT nextval('expcat_expcat_id_seq'::regclass);


--
-- Name: file_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY file ALTER COLUMN file_id SET DEFAULT nextval('file_file_id_seq'::regclass);


--
-- Name: filter_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY filter ALTER COLUMN filter_id SET DEFAULT nextval('filter_filter_id_seq'::regclass);


--
-- Name: fincharg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY fincharg ALTER COLUMN fincharg_id SET DEFAULT nextval('fincharg_fincharg_id_seq'::regclass);


--
-- Name: flcol_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flcol ALTER COLUMN flcol_id SET DEFAULT nextval('flcol_flcol_id_seq'::regclass);


--
-- Name: flgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flgrp ALTER COLUMN flgrp_id SET DEFAULT nextval('flgrp_flgrp_id_seq'::regclass);


--
-- Name: flhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flhead ALTER COLUMN flhead_id SET DEFAULT nextval('flhead_flhead_id_seq'::regclass);


--
-- Name: flitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flitem ALTER COLUMN flitem_id SET DEFAULT nextval('flitem_flitem_id_seq'::regclass);


--
-- Name: flnotes_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flnotes ALTER COLUMN flnotes_id SET DEFAULT nextval('flnotes_flnotes_id_seq'::regclass);


--
-- Name: flrpt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flrpt ALTER COLUMN flrpt_id SET DEFAULT nextval('flrpt_flrpt_id_seq'::regclass);


--
-- Name: flspec_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY flspec ALTER COLUMN flspec_id SET DEFAULT nextval('flspec_flspec_id_seq'::regclass);


--
-- Name: freightclass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY freightclass ALTER COLUMN freightclass_id SET DEFAULT nextval('freightclass_freightclass_id_seq'::regclass);


--
-- Name: grp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY grp ALTER COLUMN grp_id SET DEFAULT nextval('grp_grp_id_seq'::regclass);


--
-- Name: grppriv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY grppriv ALTER COLUMN grppriv_id SET DEFAULT nextval('grppriv_grppriv_id_seq'::regclass);


--
-- Name: hnfc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY hnfc ALTER COLUMN hnfc_id SET DEFAULT nextval('hnfc_hnfc_id_seq'::regclass);


--
-- Name: incdt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdt ALTER COLUMN incdt_id SET DEFAULT nextval('incdt_incdt_id_seq'::regclass);


--
-- Name: incdtcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtcat ALTER COLUMN incdtcat_id SET DEFAULT nextval('incdtcat_incdtcat_id_seq'::regclass);


--
-- Name: incdthist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdthist ALTER COLUMN incdthist_id SET DEFAULT nextval('incdthist_incdthist_id_seq'::regclass);


--
-- Name: incdtpriority_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtpriority ALTER COLUMN incdtpriority_id SET DEFAULT nextval('incdtpriority_incdtpriority_id_seq'::regclass);


--
-- Name: incdtresolution_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtresolution ALTER COLUMN incdtresolution_id SET DEFAULT nextval('incdtresolution_incdtresolution_id_seq'::regclass);


--
-- Name: incdtseverity_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY incdtseverity ALTER COLUMN incdtseverity_id SET DEFAULT nextval('incdtseverity_incdtseverity_id_seq'::regclass);


--
-- Name: invbal_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invbal ALTER COLUMN invbal_id SET DEFAULT nextval('invbal_invbal_id_seq'::regclass);


--
-- Name: invchead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invchead ALTER COLUMN invchead_id SET DEFAULT nextval('invchead_invchead_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: invcitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitem ALTER COLUMN invcitem_id SET DEFAULT nextval('invcitem_invcitem_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invcitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: invhistexpcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY invhistexpcat ALTER COLUMN invhistexpcat_id SET DEFAULT nextval('invhistexpcat_invhistexpcat_id_seq'::regclass);


--
-- Name: ipsass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsass ALTER COLUMN ipsass_id SET DEFAULT nextval('ipsass_ipsass_id_seq'::regclass);


--
-- Name: ipsfreight_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsfreight ALTER COLUMN ipsfreight_id SET DEFAULT nextval('ipsfreight_ipsfreight_id_seq'::regclass);


--
-- Name: ipsitemchar_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsitemchar ALTER COLUMN ipsitemchar_id SET DEFAULT nextval('ipsitemchar_ipsitemchar_id_seq'::regclass);


--
-- Name: ipsprodcat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ipsprodcat_bak ALTER COLUMN ipsprodcat_id SET DEFAULT nextval('ipsprodcat_ipsprodcat_id_seq'::regclass);


--
-- Name: itemlocpost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemlocpost ALTER COLUMN itemlocpost_id SET DEFAULT nextval('itemlocpost_itemlocpost_id_seq'::regclass);


--
-- Name: itemtax_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtax ALTER COLUMN itemtax_id SET DEFAULT nextval('itemtax_itemtax_id_seq'::regclass);


--
-- Name: itemtrans_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemtrans ALTER COLUMN itemtrans_id SET DEFAULT nextval('itemtrans_itemtrans_id_seq'::regclass);


--
-- Name: itemuom_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuom ALTER COLUMN itemuom_id SET DEFAULT nextval('itemuom_itemuom_id_seq'::regclass);


--
-- Name: itemuomconv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY itemuomconv ALTER COLUMN itemuomconv_id SET DEFAULT nextval('itemuomconv_itemuomconv_id_seq'::regclass);


--
-- Name: labeldef_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY labeldef ALTER COLUMN labeldef_id SET DEFAULT nextval('labeldef_labeldef_id_seq'::regclass);


--
-- Name: lang_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY lang ALTER COLUMN lang_id SET DEFAULT nextval('lang_lang_id_seq'::regclass);


--
-- Name: metasql_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY metasql ALTER COLUMN metasql_id SET DEFAULT nextval('metasql_metasql_id_seq'::regclass);


--
-- Name: metricenc_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY metricenc ALTER COLUMN metricenc_id SET DEFAULT nextval('metricenc_metricenc_id_seq'::regclass);


--
-- Name: ophead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY ophead ALTER COLUMN ophead_id SET DEFAULT nextval('ophead_ophead_id_seq'::regclass);


--
-- Name: opsource_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY opsource ALTER COLUMN opsource_id SET DEFAULT nextval('opsource_opsource_id_seq'::regclass);


--
-- Name: opstage_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY opstage ALTER COLUMN opstage_id SET DEFAULT nextval('opstage_opstage_id_seq'::regclass);


--
-- Name: optype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY optype ALTER COLUMN optype_id SET DEFAULT nextval('optype_optype_id_seq'::regclass);


--
-- Name: pack_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pack ALTER COLUMN pack_id SET DEFAULT nextval('pack_pack_id_seq'::regclass);


--
-- Name: payco_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY payco ALTER COLUMN payco_id SET DEFAULT nextval('payco_payco_id_seq'::regclass);


--
-- Name: period_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY period ALTER COLUMN period_id SET DEFAULT nextval('period_period_id_seq'::regclass);


--
-- Name: pkgdep_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgdep ALTER COLUMN pkgdep_id SET DEFAULT nextval('pkgdep_pkgdep_id_seq'::regclass);


--
-- Name: pkghead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkghead ALTER COLUMN pkghead_id SET DEFAULT nextval('pkghead_pkghead_id_seq'::regclass);


--
-- Name: pkgitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY pkgitem ALTER COLUMN pkgitem_id SET DEFAULT nextval('pkgitem_pkgitem_id_seq'::regclass);


--
-- Name: prftcntr_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prftcntr ALTER COLUMN prftcntr_id SET DEFAULT nextval('prftcntr_prftcntr_id_seq'::regclass);


--
-- Name: prj_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prj ALTER COLUMN prj_id SET DEFAULT nextval('prj_prj_id_seq'::regclass);


--
-- Name: prjtask_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtask ALTER COLUMN prjtask_id SET DEFAULT nextval('prjtask_prjtask_id_seq'::regclass);


--
-- Name: prjtaskuser_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtaskuser ALTER COLUMN prjtaskuser_id SET DEFAULT nextval('prjtaskuser_prjtaskuser_id_seq'::regclass);


--
-- Name: prjtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY prjtype ALTER COLUMN prjtype_id SET DEFAULT nextval('prjtype_prjtype_id_seq'::regclass);


--
-- Name: qryhead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY qryhead ALTER COLUMN qryhead_id SET DEFAULT nextval('qryhead_qryhead_id_seq'::regclass);


--
-- Name: qryitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY qryitem ALTER COLUMN qryitem_id SET DEFAULT nextval('qryitem_qryitem_id_seq'::regclass);


--
-- Name: recur_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recur ALTER COLUMN recur_id SET DEFAULT nextval('recur_recur_id_seq'::regclass);


--
-- Name: recurtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recurtype ALTER COLUMN recurtype_id SET DEFAULT nextval('recurtype_recurtype_id_seq'::regclass);


--
-- Name: recv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY recv ALTER COLUMN recv_id SET DEFAULT nextval('recv_recv_id_seq'::regclass);


--
-- Name: rsncode_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY rsncode ALTER COLUMN rsncode_id SET DEFAULT nextval('rsncode_rsncode_id_seq'::regclass);


--
-- Name: salescat_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY salescat ALTER COLUMN salescat_id SET DEFAULT nextval('salescat_salescat_id_seq'::regclass);


--
-- Name: saletype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY saletype ALTER COLUMN saletype_id SET DEFAULT nextval('saletype_saletype_id_seq'::regclass);


--
-- Name: schemaord_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY schemaord ALTER COLUMN schemaord_id SET DEFAULT nextval('schemaord_schemaord_id_seq'::regclass);


--
-- Name: script_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY script ALTER COLUMN script_id SET DEFAULT nextval('script_script_id_seq'::regclass);


--
-- Name: shift_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shift ALTER COLUMN shift_id SET DEFAULT nextval('shift_shift_id_seq'::regclass);


--
-- Name: shipchrg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipchrg ALTER COLUMN shipchrg_id SET DEFAULT nextval('shipchrg_shipchrg_id_seq'::regclass);


--
-- Name: shiphead_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shiphead ALTER COLUMN shiphead_id SET DEFAULT nextval('shiphead_shiphead_id_seq'::regclass);


--
-- Name: shipitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY shipitem ALTER COLUMN shipitem_id SET DEFAULT nextval('shipitem_shipitem_id_seq'::regclass);


--
-- Name: sitetype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY sitetype ALTER COLUMN sitetype_id SET DEFAULT nextval('sitetype_sitetype_id_seq'::regclass);


--
-- Name: source_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY source ALTER COLUMN source_id SET DEFAULT nextval('source_source_id_seq'::regclass);


--
-- Name: state_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY state ALTER COLUMN state_id SET DEFAULT nextval('state_state_id_seq'::regclass);


--
-- Name: status_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY status ALTER COLUMN status_id SET DEFAULT nextval('status_status_id_seq'::regclass);


--
-- Name: stdjrnl_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnl ALTER COLUMN stdjrnl_id SET DEFAULT nextval('stdjrnl_stdjrnl_id_seq'::regclass);


--
-- Name: stdjrnlgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlgrp ALTER COLUMN stdjrnlgrp_id SET DEFAULT nextval('stdjrnlgrp_stdjrnlgrp_id_seq'::regclass);


--
-- Name: stdjrnlgrpitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlgrpitem ALTER COLUMN stdjrnlgrpitem_id SET DEFAULT nextval('stdjrnlgrpitem_stdjrnlgrpitem_id_seq'::regclass);


--
-- Name: stdjrnlitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY stdjrnlitem ALTER COLUMN stdjrnlitem_id SET DEFAULT nextval('stdjrnlitem_stdjrnlitem_id_seq'::regclass);


--
-- Name: subaccnt_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY subaccnt ALTER COLUMN subaccnt_id SET DEFAULT nextval('subaccnt_subaccnt_id_seq'::regclass);


--
-- Name: subaccnttype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY subaccnttype ALTER COLUMN subaccnttype_id SET DEFAULT nextval('subaccnttype_subaccnttype_id_seq'::regclass);


--
-- Name: taxass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxass ALTER COLUMN taxass_id SET DEFAULT nextval('taxass_taxass_id_seq'::regclass);


--
-- Name: taxauth_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxauth ALTER COLUMN taxauth_id SET DEFAULT nextval('taxauth_taxauth_id_seq'::regclass);


--
-- Name: taxclass_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxclass ALTER COLUMN taxclass_id SET DEFAULT nextval('taxclass_taxclass_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxhist ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: taxpay_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxpay ALTER COLUMN taxpay_id SET DEFAULT nextval('taxpay_taxpay_id_seq'::regclass);


--
-- Name: taxrate_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxrate ALTER COLUMN taxrate_id SET DEFAULT nextval('taxrate_taxrate_id_seq'::regclass);


--
-- Name: taxreg_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxreg ALTER COLUMN taxreg_id SET DEFAULT nextval('taxreg_taxreg_id_seq'::regclass);


--
-- Name: taxtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxtype ALTER COLUMN taxtype_id SET DEFAULT nextval('taxtype_taxtype_id_seq'::regclass);


--
-- Name: taxzone_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY taxzone ALTER COLUMN taxzone_id SET DEFAULT nextval('taxzone_taxzone_id_seq'::regclass);


--
-- Name: todoitem_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY todoitem ALTER COLUMN todoitem_id SET DEFAULT nextval('todoitem_todoitem_id_seq'::regclass);


--
-- Name: trialbal_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY trialbal ALTER COLUMN trialbal_id SET DEFAULT nextval('trialbal_trialbal_id_seq'::regclass);


--
-- Name: uiform_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uiform ALTER COLUMN uiform_id SET DEFAULT nextval('uiform_uiform_id_seq'::regclass);


--
-- Name: uom_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uom ALTER COLUMN uom_id SET DEFAULT nextval('uom_uom_id_seq'::regclass);


--
-- Name: uomconv_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomconv ALTER COLUMN uomconv_id SET DEFAULT nextval('uomconv_uomconv_id_seq'::regclass);


--
-- Name: uomtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY uomtype ALTER COLUMN uomtype_id SET DEFAULT nextval('uomtype_uomtype_id_seq'::regclass);


--
-- Name: url_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY urlinfo ALTER COLUMN url_id SET DEFAULT nextval('urlinfo_url_id_seq'::regclass);


--
-- Name: usrgrp_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY usrgrp ALTER COLUMN usrgrp_id SET DEFAULT nextval('usrgrp_usrgrp_id_seq'::regclass);


--
-- Name: vendtype_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY vendtype ALTER COLUMN vendtype_id SET DEFAULT nextval('vendtype_vendtype_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voheadtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: taxhist_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY voitemtax ALTER COLUMN taxhist_id SET DEFAULT nextval('taxhist_taxhist_id_seq'::regclass);


--
-- Name: whsezone_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY whsezone ALTER COLUMN whsezone_id SET DEFAULT nextval('whsezone_whsezone_id_seq'::regclass);


--
-- Name: womatlpost_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY womatlpost ALTER COLUMN womatlpost_id SET DEFAULT nextval('womatlpost_womatlpost_id_seq'::regclass);


--
-- Name: xsltmap_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY xsltmap ALTER COLUMN xsltmap_id SET DEFAULT nextval('xsltmap_xsltmap_id_seq'::regclass);


--
-- Name: yearperiod_id; Type: DEFAULT; Schema: public; Owner: admin
--

ALTER TABLE ONLY yearperiod ALTER COLUMN yearperiod_id SET DEFAULT nextval('yearperiod_yearperiod_id_seq'::regclass);



--
-- Name: metasql_grade; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- Name: script_enabled; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- Name: uiform_enabled; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;


--
-- Name: tecustrate_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tecustrate ALTER COLUMN tecustrate_id SET DEFAULT nextval('tecustrate_tecustrate_id_seq'::regclass);


--
-- Name: teemp_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teemp ALTER COLUMN teemp_id SET DEFAULT nextval('teemp_teemp_id_seq'::regclass);


--
-- Name: tehead_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY tehead ALTER COLUMN tehead_id SET DEFAULT nextval('tehead_tehead_id_seq'::regclass);


--
-- Name: teitem_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teitem ALTER COLUMN teitem_id SET DEFAULT nextval('teitem_teitem_id_seq'::regclass);


--
-- Name: teprj_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprj ALTER COLUMN teprj_id SET DEFAULT nextval('teprj_teprj_id_seq'::regclass);


--
-- Name: teprjtask_id; Type: DEFAULT; Schema: te; Owner: admin
--

ALTER TABLE ONLY teprjtask ALTER COLUMN teprjtask_id SET DEFAULT nextval('teprjtask_teprjtask_id_seq'::regclass);



--
-- Name: js_id; Type: DEFAULT; Schema: xt; Owner: admin
--

ALTER TABLE ONLY js ALTER COLUMN js_id SET DEFAULT nextval('js_js_id_seq'::regclass);



--
-- Name: metasql_grade; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkgmetasql ALTER COLUMN metasql_grade SET DEFAULT 0;


--
-- Name: script_enabled; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkgscript ALTER COLUMN script_enabled SET DEFAULT false;


--
-- Name: uiform_enabled; Type: DEFAULT; Schema: xtdesktop; Owner: admin
--

ALTER TABLE ONLY pkguiform ALTER COLUMN uiform_enabled SET DEFAULT false;



--
-- Data for Name: pkgcmd; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgcmd (cmd_id, cmd_module, cmd_title, cmd_descrip, cmd_privname, cmd_executable, cmd_name) FROM stdin;
\.


--
-- Data for Name: pkgcmdarg; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgcmdarg (cmdarg_id, cmdarg_cmd_id, cmdarg_order, cmdarg_arg) FROM stdin;
\.


--
-- Data for Name: pkgimage; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgimage (image_id, image_name, image_descrip, image_data) FROM stdin;
\.


--
-- Data for Name: pkgmetasql; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgmetasql (metasql_id, metasql_group, metasql_name, metasql_notes, metasql_query, metasql_lastuser, metasql_lastupdate, metasql_grade) FROM stdin;
449	fixcountry	strictcountrycheck	select details about countries used throughout the database that do not match country.country_name a copy of crm_strictcountrycheck to avoid problems later if someone disables or removes the fixCountry package	-- Group: fixcountry\n-- Name:  strictcountrycheck\n-- Notes: select details about countries used throughout the database\n--        that do not match country.country_name\n--        a copy of crm_strictcountrycheck to avoid problems later if\n--        someone disables or removes the fixCountry package\n<? if exists("count") ?>\nSELECT SUM(counter) AS counter FROM (\n<? endif ?>\n  SELECT <? if exists("count") ?> COUNT(*) AS counter\n         <? else ?> addr_id, 'Address' AS type, addr_number AS number, addr_country AS country, '' AS detail\n         <? endif ?>\n    FROM addr\n   WHERE addr_country != ''\n     AND addr_country NOT IN (SELECT country_name\n                                FROM country\n                               WHERE country_name IS NOT NULL)\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> cmhead_id, 'Credit Memo', cmhead_number, cmhead_billtocountry, 'Bill-To'\n         <? endif ?>\n    FROM cmhead\n   WHERE cmhead_billtocountry != ''\n     AND cmhead_billtocountry NOT IN (SELECT country_name\n                                        FROM country\n                                       WHERE country_name IS NOT NULL)\n     <? if not exists("showAll") ?> AND (NOT cmhead_posted) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> cmhead_id, 'Credit Memo', cmhead_number, cmhead_billtocountry, 'Ship-To'\n         <? endif ?>\n    FROM cmhead\n    WHERE cmhead_shipto_country != ''\n      AND cmhead_shipto_country NOT IN (SELECT country_name\n                                          FROM country\n                                         WHERE country_name IS NOT NULL)\n      <? if not exists("showAll") ?> AND (NOT cmhead_posted) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> invchead_id, 'Invoice', invchead_invcnumber, invchead_billto_country, 'Bill-To'\n         <? endif ?>\n    FROM invchead\n   WHERE invchead_billto_country != ''\n     AND invchead_billto_country NOT IN (SELECT country_name\n                                           FROM country\n                                          WHERE country_name IS NOT NULL)\n     <? if not exists("showAll") ?> AND (NOT invchead_posted) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> invchead_id, 'Invoice', invchead_invcnumber, invchead_shipto_country, 'Ship-To'\n         <? endif ?>\n    FROM invchead\n   WHERE invchead_shipto_country != ''\n     AND invchead_shipto_country NOT IN (SELECT country_name\n                                           FROM country\n                                          WHERE country_name IS NOT NULL)\n     <? if not exists("showAll") ?> AND (NOT invchead_posted) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> quhead_id, 'Quote', CAST(quhead_number AS TEXT), quhead_billtocountry, 'Bill-To'\n         <? endif ?>\n    FROM quhead\n   WHERE quhead_billtocountry != ''\n     AND quhead_billtocountry NOT IN (SELECT country_name\n                                        FROM country\n                                       WHERE country_name IS NOT NULL)\n     <? if not exists("showAll") ?> AND (quhead_expire>=CURRENT_DATE) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> quhead_id, 'Quote', CAST(quhead_number AS TEXT), quhead_shiptocountry, 'Ship-To'\n         <? endif ?>\n    FROM quhead\n   WHERE quhead_shiptocountry != ''\n     AND quhead_shiptocountry NOT IN (SELECT country_name\n                                        FROM country\n                                       WHERE country_name IS NOT NULL)\n     <? if not exists("showAll") ?> AND (quhead_expire>=CURRENT_DATE) <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> cohead_id, 'Sales Order', cohead_number, cohead_billtocountry, 'Bill-To'\n         <? endif ?>\n    FROM cohead\n   WHERE cohead_billtocountry != ''\n     AND cohead_billtocountry NOT IN (SELECT country_name\n                                        FROM country\n                                       WHERE country_name IS NOT NULL)\n    <? if not exists("showAll") ?>\n     AND cohead_id IN (SELECT coitem_cohead_id\n                         FROM coitem\n                        WHERE COALESCE(coitem_status, 'O')='O')\n    <? endif ?>\n  UNION ALL\n  SELECT <? if exists("count") ?> COUNT(*)\n         <? else ?> cohead_id, 'Sales Order', cohead_number, cohead_shiptocountry, 'Ship-To'\n         <? endif ?>\n    FROM cohead\n   WHERE cohead_shiptocountry != ''\n     AND cohead_shiptocountry NOT IN (SELECT country_name\n                                       FROM country\n                                      WHERE country_name IS NOT NULL)\n    <? if not exists("showAll") ?>\n     AND cohead_id IN (SELECT coitem_cohead_id\n                         FROM coitem\n                        WHERE COALESCE(coitem_status, 'O')='O')\n    <? endif ?>\n\n<? if exists("count") ?>\n) AS dummy;\n<? endif ?>\n	\N	\N	0
\.


--
-- Data for Name: pkgpriv; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgpriv (priv_id, priv_module, priv_name, priv_descrip, priv_seq) FROM stdin;
\.


--
-- Data for Name: pkgreport; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgreport (report_id, report_name, report_sys, report_source, report_descrip, report_grade, report_loaddate) FROM stdin;
\.


--
-- Data for Name: pkgscript; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkgscript (script_id, script_name, script_order, script_enabled, script_source, script_notes) FROM stdin;
124	initMenu	0	t	function sFixCountries()\n{\n  try {\n  var newdlg = toolbox.openWindow("fixCountries", 0, Qt.Window, Qt.NonModal);\n  } catch(e) { print("sFixCountries exception: " + e); }\n}\n\nvar _crmutilsmenu = mainwindow.findChild("menu.crm.utilities");\nvar fixCountriesAction = _crmutilsmenu.addAction(\n                  qsTr("Fix Countries before setting Strict Countries option"));\nfixCountriesAction.enabled = privileges.value("MaintainAddresses")   &&\n                             privileges.value("MaintainCreditMemos") &&\n                             privileges.value("MaintainMiscInvoices")&&\n                             privileges.value("MaintainSalesOrders") &&\n                             privileges.value("MaintainQuotes");\n\nfixCountriesAction.triggered.connect(sFixCountries);\n	
125	fixCountries	0	t	var _addCountry = mywindow.findChild("_addCountry");\nvar _edit       = mywindow.findChild("_edit");\nvar _fixAbbr    = mywindow.findChild("_fixAbbr");\nvar _fixBulk    = mywindow.findChild("_fixBulk");\nvar _fixCase    = mywindow.findChild("_fixCase");\nvar _list       = mywindow.findChild("_list");\nvar _query      = mywindow.findChild("_query");\nvar _showAll    = mywindow.findChild("_showAll");\n\n_list.addColumn("Record Type", -1, Qt.AlignLeft, true, "type");\n_list.addColumn("Number",      -1, Qt.AlignLeft, true, "number");\n_list.addColumn("Country",     -1, Qt.AlignLeft, true, "country");\n_list.addColumn("Details",     -1, Qt.AlignLeft, true, "detail");\n\nfunction sAddCountry()\n{\n  try {\n  var params = new Object;;\n  params.mode = "new";\n\n  var newdlg = toolbox.openWindow("country", mywindow, Qt.Dialog, Qt.WindowModal);\n  toolbox.lastWindow().set(params);\n  newdlg.exec();\n  } catch (e) { print("sAddCountry exception: " + e); }\n}\n\nfunction openEditorWindow(pwindow, pidname, pparent)\n{\n  try {\n  var params = new Object;\n  params[pidname] = _list.id();\n  if (pidname == 'quhead_id')\n    params.mode = "editQuote";\n  else\n    params.mode = "edit";\n\n  var newdlg = toolbox.openWindow(pwindow, pparent, Qt.Dialog, Qt.WindowModal);\n  toolbox.lastWindow().set(params);\n  newdlg.exec();\n  } catch(e) { print("openEditorWindow exception (" + e.lineNumber + "): " + e); }\n}\n\nfunction sEdit()\n{\n  try {\n  var currentItem = _list.currentItem();\n\n  switch (currentItem.text(0))\n  {\n    case 'Address':\n      openEditorWindow("address", "addr_id", mywindow);\n      break;\n\n    case 'Credit Memo':\n      openEditorWindow("creditMemo", "cmhead_id", 0);\n      break;\n\n    case 'Invoice':\n      openEditorWindow("invoice", "invchead_id", mywindow);\n      break;\n\n    case 'Quote':\n      openEditorWindow("salesOrder", "quhead_id", 0);\n      break;\n\n    case 'Sales Order':\n      openEditorWindow("salesOrder", "sohead_id", 0);\n      break;\n  }\n  sFillList();\n  } catch (e) { print("sEdit() exception: " + e); }\n}\n\nfunction sFixBulk()\n{\n  print("sFixBulk() entered");\n  try {\n    var params = new Object;\n    if (_showAll.checked)\n      params.showAll = true;\n\n    var newdlg = toolbox.openWindow("bulkFixCountry", mywindow,\n                                    Qt.WindowModal, Qt.Dialog);\n    toolbox.lastWindow().set(params);\n\n    sFillList();\n  } catch (e) { print("sFixBulk() exception: " + e); }\n}\n\nfunction sFixCase()\n{\n  try {\n  if (QMessageBox.question(mywindow, qsTr("Are you sure?"),\n                           qsTr("<p>Are you sure that you want to change all "\n                              + "countries that appear to be correct except "\n                              + "for upper- and lower-case differences in a "\n                              + "batch?<p>(This change will obey the status "\n                              + "of the 'Show closed records' check box."),\n                           QMessageBox.Yes, QMessageBox.No) == QMessageBox.No)\n    return;\n\n  var params = new Object;\n  if (_showAll.checked)\n    params.showAll = true;\n\n  var qry = toolbox.executeQuery(\n      "UPDATE addr SET addr_country = country_name"\n    + "  FROM country "\n    + " WHERE addr_country != ''"\n    + "   AND UPPER(addr_country) = UPPER(country_name)"\n    + "   AND addr_country != country_name;", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Address: " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cmhead SET cmhead_billtocountry = country_name"\n    + "  FROM country "\n    + " WHERE cmhead_billtocountry != ''"\n    + "   AND UPPER(cmhead_billtocountry) = UPPER(country_name)"\n    + "   AND cmhead_billtocountry != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cmhead SET cmhead_shipto_country = country_name"\n    + "  FROM country "\n    + " WHERE cmhead_shipto_country != ''"\n    + "   AND UPPER(cmhead_shipto_country) = UPPER(country_name)"\n    + "   AND cmhead_shipto_country != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE invchead SET invchead_billto_country = country_name"\n    + "  FROM country "\n    + " WHERE invchead_billto_country != ''"\n    + "   AND UPPER(invchead_billto_country) = UPPER(country_name)"\n    + "   AND invchead_billto_country != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE invchead SET invchead_shipto_country = country_name"\n    + "  FROM country "\n    + " WHERE invchead_shipto_country != ''"\n    + "   AND UPPER(invchead_shipto_country) = UPPER(country_name)"\n    + "   AND invchead_shipto_country != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE quhead SET quhead_billtocountry = country_name"\n    + "  FROM country"\n    + " WHERE quhead_billtocountry != ''"\n    + "   AND UPPER(quhead_billtocountry) = UPPER(country_name)"\n    + "   AND quhead_billtocountry != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE quhead SET quhead_shiptocountry = country_name"\n    + "  FROM country"\n    + " WHERE quhead_shiptocountry != ''"\n    + "   AND UPPER(quhead_shiptocountry) = UPPER(country_name)"\n    + "   AND quhead_shiptocountry != country_name"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cohead SET cohead_billtocountry = country_name"\n    + '  FROM country <? if not exists("showAll") ?>, coitem<? endif ?>'\n    + " WHERE cohead_billtocountry != ''"\n    + "   AND UPPER(cohead_billtocountry) = UPPER(country_name)"\n    + "   AND cohead_billtocountry != country_name"\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id=coitem_cohead_id AND COALESCE(coitem_status, 'O')='O'"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cohead SET cohead_shiptocountry = country_name"\n    + '  FROM country <? if not exists("showAll") ?>, coitem<? endif ?>'\n    + " WHERE cohead_shiptocountry != ''"\n    + "   AND UPPER(cohead_shiptocountry) = UPPER(country_name)"\n    + "   AND cohead_shiptocountry != country_name"\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id=coitem_cohead_id AND COALESCE(coitem_status, 'O')='O'"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Ship-To): " + qry.lastError().text);\n\n  } catch (e) { QMessageBox.critical(mywindow, "sFixCase() exception", e); }\n\n  sFillList();\n}\n\nfunction sFixAbbr()\n{\n  try {\n  if (QMessageBox.question(mywindow, qsTr("Are you sure?"),\n                           qsTr("<p>Are you sure that you want to replace all "\n                              + "country abbreviations to the corresponding "\n                              + "full country names?<p>(This change will obey "\n                              + "the status of the 'Show closed records' "\n                              + "check box."),\n                       QMessageBox.Yes, QMessageBox.No) == QMessageBox.No)\n    return;\n\n  var params = new Object;\n  if (_showAll.checked)\n    params.showAll = true;\n\n  var qry = toolbox.executeQuery(\n      "UPDATE addr SET addr_country = country_name"\n    + "  FROM country "\n    + " WHERE addr_country != ''"\n    + "   AND UPPER(addr_country) = UPPER(country_abbr);", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Address: " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cmhead SET cmhead_billtocountry = country_name"\n    + "  FROM country "\n    + " WHERE cmhead_billtocountry != ''"\n    + "   AND UPPER(cmhead_billtocountry) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cmhead SET cmhead_shipto_country = country_name"\n    + "  FROM country "\n    + " WHERE cmhead_shipto_country != ''"\n    + "   AND UPPER(cmhead_shipto_country) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE invchead SET invchead_billto_country = country_name"\n    + "  FROM country "\n    + " WHERE invchead_billto_country != ''"\n    + "   AND UPPER(invchead_billto_country) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE invchead SET invchead_shipto_country = country_name"\n    + "  FROM country "\n    + " WHERE invchead_shipto_country != ''"\n    + "   AND UPPER(invchead_shipto_country) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE quhead SET quhead_billtocountry = country_name"\n    + "  FROM country"\n    + " WHERE quhead_billtocountry != ''"\n    + "   AND UPPER(quhead_billtocountry) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE quhead SET quhead_shiptocountry = country_name"\n    + "  FROM country"\n    + " WHERE quhead_shiptocountry != ''"\n    + "   AND UPPER(quhead_shiptocountry) = UPPER(country_abbr)"\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cohead SET cohead_billtocountry = country_name"\n    + '  FROM country <? if not exists("showAll") ?>, coitem<? endif ?>'\n    + " WHERE cohead_billtocountry != ''"\n    + "   AND UPPER(cohead_billtocountry) = UPPER(country_abbr)"\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id=coitem_cohead_id AND COALESCE(coitem_status, 'O')='O'"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      "UPDATE cohead SET cohead_shiptocountry = country_name"\n    + '  FROM country <? if not exists("showAll") ?>, coitem<? endif ?>'\n    + " WHERE cohead_shiptocountry != ''"\n    + "   AND UPPER(cohead_shiptocountry) = UPPER(country_abbr)"\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id=coitem_cohead_id AND COALESCE(coitem_status, 'O')='O'"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Ship-To): " + qry.lastError().text);\n\n  } catch (e)\n  {\n    QMessageBox.critical(mywindow, "sFixAbbr() exception", e);\n  }\n  sFillList();\n}\n\nfunction sFillList()\n{\n  try {\n  var params = new Object;\n  if (_showAll.checked)\n    params.showAll = true;\n\n  var qry = toolbox.executeDbQuery('fixcountry', 'strictcountrycheck', params);\n  _list.populate(qry);\n  if (qry.lastError().type != 0)\n  {\n    QMessageBox.critical(mywindow, qsTr("Database Error"),\n                         qry.lastError().text);\n    return;\n  }\n  } catch (e) { print("sFillList exception: " + e); }\n}\n\n_addCountry.clicked.connect(sAddCountry);\n_edit.clicked.connect(sEdit);\n_fixAbbr.clicked.connect(sFixAbbr);\n_fixBulk.clicked.connect(sFixBulk);\n_fixCase.clicked.connect(sFixCase);\n_query.clicked.connect(sFillList);\n_showAll.toggled.connect(sFillList);\n\nsFillList();\n\nif (QMessageBox.question(mywindow, qsTr("Backed Up?"),\n                         qsTr("<p>Have you backed up your database? "\n                            + "You really should back up your database "\n                            + "before running this utility."),\n                         QMessageBox.Yes, QMessageBox.No) == QMessageBox.No)\n  mywindow.close()\n\n	
126	bulkFixCountry	0	t	var _buttons    = mywindow.findChild("_buttons");\nvar _oldCountry = mywindow.findChild("_oldCountry");\nvar _newCountry = mywindow.findChild("_newCountry");\nvar _params;\n\nfunction set(params)\n{\n  _params = params;\n  var qry = toolbox.executeQuery(\n      "SELECT MIN(id), country, country AS code "\n    + "  FROM ("\n    + "  SELECT addr_id AS id, addr_country AS country"\n    + "    FROM addr"\n    + "   WHERE addr_country != ''"\n    + "     AND addr_country NOT IN (SELECT country_name"\n    + "                                FROM country"\n    + "                               WHERE country_name IS NOT NULL)"\n    + "  UNION ALL"\n    + "  SELECT cmhead_id, cmhead_billtocountry"\n    + "    FROM cmhead"\n    + "   WHERE cmhead_billtocountry != ''"\n    + "     AND cmhead_billtocountry NOT IN (SELECT country_name"\n    + "                                        FROM country"\n    + "                                       WHERE country_name IS NOT NULL)"\n    + '     <? if not exists("showAll") ?> AND (NOT cmhead_posted) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT cmhead_id, cmhead_shipto_country"\n    + "    FROM cmhead"\n    + "    WHERE cmhead_shipto_country != ''"\n    + "      AND cmhead_shipto_country NOT IN (SELECT country_name"\n    + "                                          FROM country"\n    + "                                         WHERE country_name IS NOT NULL)"\n    + '      <? if not exists("showAll") ?> AND (NOT cmhead_posted) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT invchead_id, invchead_billto_country"\n    + "    FROM invchead"\n    + "   WHERE invchead_billto_country != ''"\n    + "     AND invchead_billto_country NOT IN (SELECT country_name"\n    + "                                           FROM country"\n    + "                                          WHERE country_name IS NOT NULL)"\n    + '     <? if not exists("showAll") ?> AND (NOT invchead_posted) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT invchead_id, invchead_shipto_country"\n    + "    FROM invchead"\n    + "   WHERE invchead_shipto_country != ''"\n    + "     AND invchead_shipto_country NOT IN (SELECT country_name"\n    + "                                           FROM country"\n    + "                                          WHERE country_name IS NOT NULL)"\n    + '     <? if not exists("showAll") ?> AND (NOT invchead_posted) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT quhead_id, quhead_billtocountry"\n    + "    FROM quhead"\n    + "   WHERE quhead_billtocountry != ''"\n    + "     AND quhead_billtocountry NOT IN (SELECT country_name"\n    + "                                        FROM country"\n    + "                                       WHERE country_name IS NOT NULL)"\n    + '     <? if not exists("showAll") ?> AND (quhead_expire>=CURRENT_DATE) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT quhead_id, quhead_shiptocountry"\n    + "    FROM quhead"\n    + "   WHERE quhead_shiptocountry != ''"\n    + "     AND quhead_shiptocountry NOT IN (SELECT country_name"\n    + "                                        FROM country"\n    + "                                       WHERE country_name IS NOT NULL)"\n    + '     <? if not exists("showAll") ?> AND (quhead_expire>=CURRENT_DATE) <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT cohead_id, cohead_billtocountry"\n    + "    FROM cohead"\n    + "   WHERE cohead_billtocountry != ''"\n    + "     AND cohead_billtocountry NOT IN (SELECT country_name"\n    + "                                        FROM country"\n    + "                                       WHERE country_name IS NOT NULL)"\n    + '    <? if not exists("showAll") ?>'\n    + "     AND cohead_id IN (SELECT coitem_cohead_id"\n    + "                         FROM coitem"\n    + "                        WHERE COALESCE(coitem_status, 'O')='O')"\n    + '    <? endif ?>'\n    + "  UNION ALL"\n    + "  SELECT cohead_id, cohead_shiptocountry"\n    + "    FROM cohead"\n    + "   WHERE cohead_shiptocountry != ''"\n    + "     AND cohead_shiptocountry NOT IN (SELECT country_name"\n    + "                                       FROM country"\n    + "                                      WHERE country_name IS NOT NULL)"\n    + '    <? if not exists("showAll") ?>'\n    + "     AND cohead_id IN (SELECT coitem_cohead_id"\n    + "                         FROM coitem"\n    + "                        WHERE COALESCE(coitem_status, 'O')='O')"\n    + '    <? endif ?>'\n    + ") AS dummy "\n    + "GROUP BY country "\n    + "ORDER BY country;",\n\n                                 params);\n  _oldCountry.populate(qry);\n  if (qry.lastError().type != 0)\n    toolbox.messageBox("warning", mywindow, qsTr("Database Error"),\n                       qry.lastError().text);\n}\n\nfunction sSave()\n{\n  try {\n  var params = _params;\n  params.oldCountry = _oldCountry.currentText;\n  params.newCountry = _newCountry.currentText;\n\n  var qry = toolbox.executeQuery(\n      'UPDATE addr SET addr_country = <? value("newCountry") ?>'\n    + ' WHERE addr_country = <? value("oldCountry") ?>;', params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Address: " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE cmhead SET cmhead_billtocountry = <? value("newCountry") ?>'\n    + ' WHERE cmhead_billtocountry = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE cmhead SET cmhead_shipto_country = <? value("newCountry") ?>'\n    + ' WHERE cmhead_shipto_country = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT cmhead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Credit Memo (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE invchead SET invchead_billto_country = <? value("newCountry") ?>'\n    + ' WHERE invchead_billto_country = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE invchead SET invchead_shipto_country = <? value("newCountry") ?>'\n    + ' WHERE invchead_shipto_country = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND NOT invchead_posted"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Invoice (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE quhead SET quhead_billtocountry = <? value("newCountry") ?>'\n    + ' WHERE quhead_billtocountry = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE quhead SET quhead_shiptocountry = <? value("newCountry") ?>'\n    + ' WHERE quhead_shiptocountry = <? value("oldCountry") ?>'\n    + '  <? if not exists("showAll") ?>'\n    + "   AND quhead_expire >= CURRENT_DATE"\n    + "  <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Quote (Ship-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE cohead SET cohead_billtocountry = <? value("newCountry") ?>'\n    + ' WHERE cohead_billtocountry = <? value("oldCountry") ?>'\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id IN (SELECT coitem_cohead_id"\n    + "                     FROM coitem"\n    + "                     WHERE COALESCE(coitem_status, 'O')='O')"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Bill-To): " + qry.lastError().text);\n\n  qry = toolbox.executeQuery(\n      'UPDATE cohead SET cohead_shiptocountry = <? value("newCountry") ?>'\n    + ' WHERE cohead_shiptocountry = <? value("oldCountry") ?>'\n    + '   <? if not exists("showAll") ?>'\n    + "   AND cohead_id IN (SELECT coitem_cohead_id"\n    + "                     FROM coitem"\n    + "                     WHERE COALESCE(coitem_status, 'O')='O')"\n    + "   <? endif ?>", params);\n  if (qry.lastError().type != 0)\n    throw new Error("Error updating Sales Order (Ship-To): " + qry.lastError().text);\n\n  }\n  catch (e)\n  {\n     toolbox.messageBox("critical", mywindow,\n                        "bulkFixCountry::sSave() exception", e);\n\n  }\n  mywindow.close();\n}\n\n_buttons.accepted.connect(sSave);\n_buttons.rejected.connect(mywindow, "close()");\n	
\.


--
-- Data for Name: pkguiform; Type: TABLE DATA; Schema: fixcountry; Owner: admin
--

COPY pkguiform (uiform_id, uiform_name, uiform_order, uiform_enabled, uiform_source, uiform_notes) FROM stdin;
58	fixCountries	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <class>fixCountries</class>\n <widget class="QWidget" name="fixCountries">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>600</height>\n   </rect>\n  </property>\n  <property name="maximumSize">\n   <size>\n    <width>1000</width>\n    <height>16777215</height>\n   </size>\n  </property>\n  <property name="windowTitle">\n   <string>fixCountries</string>\n  </property>\n  <layout class="QGridLayout" name="gridLayout">\n   <item row="1" column="1">\n    <layout class="QVBoxLayout" name="verticalLayout">\n     <item>\n      <widget class="QPushButton" name="_query">\n       <property name="text">\n        <string>Query</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name="verticalSpacer">\n       <property name="orientation">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name="sizeType">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>20</width>\n         <height>15</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_fixCase">\n       <property name="text">\n        <string>Fix Case Differences</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_fixAbbr">\n       <property name="text">\n        <string>Replace Abbreviations</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_fixBulk">\n       <property name="text">\n        <string>Bulk Replace</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name="verticalSpacer_3">\n       <property name="orientation">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name="sizeType">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>20</width>\n         <height>15</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_edit">\n       <property name="enabled">\n        <bool>false</bool>\n       </property>\n       <property name="text">\n        <string>Edit Selection</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class="QPushButton" name="_addCountry">\n       <property name="text">\n        <string>Add Country</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name="verticalSpacer_2">\n       <property name="orientation">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name="sizeHint" stdset="0">\n        <size>\n         <width>20</width>\n         <height>40</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n    </layout>\n   </item>\n   <item row="1" column="0">\n    <widget class="XTreeWidget" name="_list">\n     <property name="sizePolicy">\n      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">\n       <horstretch>0</horstretch>\n       <verstretch>3</verstretch>\n      </sizepolicy>\n     </property>\n    </widget>\n   </item>\n   <item row="2" column="0">\n    <widget class="XCheckBox" name="_showAll">\n     <property name="text">\n      <string>Show closed records</string>\n     </property>\n     <property name="forgetful">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item row="0" column="0" colspan="2">\n    <widget class="QLabel" name="label">\n     <property name="text">\n      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;\n&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;\np, li { white-space: pre-wrap; }\n&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;\n&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You must fix the countries in the following records before turning on Strict Country Checking (System &amp;gt; Configure Modules &amp;gt; CRM...).&lt;/p&gt;\n&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;\n&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Here is a short description of your options (assume the &lt;span style=&quot; font-style:italic;&quot;&gt;country&lt;/span&gt; table has a country named 'Homeland' with the abbreviation 'HL'):&lt;/p&gt;\n&lt;ul style=&quot;-qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Query&lt;/span&gt; will requery the database for records with invalid countries.&lt;/li&gt;\n&lt;li style=&quot; font-weight:600;&quot; style=&quot; margin-top:1px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Fix Case Differences&lt;span style=&quot; font-weight:400;&quot;&gt; will change all occurrences of 'HOMELAND' or 'HomeLand' to 'Homeland'.&lt;/span&gt;&lt;/li&gt;\n&lt;li style=&quot; margin-top:1px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Replace Abbreviations&lt;/span&gt; will change all occurrences of 'HL' to 'Homeland'.&lt;/li&gt;\n&lt;li style=&quot; margin-top:1px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Bulk Replace&lt;/span&gt; will replace all occurrences of an invalid country that you choose with a valid country that you choose.&lt;/li&gt;\n&lt;li style=&quot; margin-top:1px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Edit Selection&lt;/span&gt; will open the selected record for you to fix. If a changed address remains on the list, delete duplicates with CRM &amp;gt; Address &amp;gt; List....&lt;/li&gt;\n&lt;li style=&quot; margin-top:1px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Add Country&lt;/span&gt; is for the rare case where you must add a new country. Try not to use this.&lt;/li&gt;\n&lt;li style=&quot; margin-top:1px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Show closed records&lt;/span&gt; will show historical data, such as closed sales orders and posted credit memos &amp;amp; invoices. These will continue to print properly if you don't fix them, but you will have to change the country if you edit and save them with Strict Country Checking turned on.&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>\n     </property>\n     <property name="textFormat">\n      <enum>Qt::RichText</enum>\n     </property>\n     <property name="wordWrap">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>XCheckBox</class>\n   <extends>QCheckBox</extends>\n   <header>xcheckbox.h</header>\n  </customwidget>\n  <customwidget>\n   <class>XTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>xtreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <tabstops>\n  <tabstop>_list</tabstop>\n  <tabstop>_showAll</tabstop>\n  <tabstop>_query</tabstop>\n  <tabstop>_fixCase</tabstop>\n  <tabstop>_fixAbbr</tabstop>\n  <tabstop>_edit</tabstop>\n  <tabstop>_addCountry</tabstop>\n </tabstops>\n <resources/>\n <connections>\n  <connection>\n   <sender>_list</sender>\n   <signal>valid(bool)</signal>\n   <receiver>_edit</receiver>\n   <slot>setEnabled(bool)</slot>\n   <hints>\n    <hint type="sourcelabel">\n     <x>551</x>\n     <y>512</y>\n    </hint>\n    <hint type="destinationlabel">\n     <x>616</x>\n     <y>503</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n	
59	bulkFixCountry	0	t	<?xml version="1.0" encoding="UTF-8"?>\n<ui version="4.0">\n <class>bulkFixCountry</class>\n <widget class="QWidget" name="bulkFixCountry">\n  <property name="geometry">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>427</width>\n    <height>162</height>\n   </rect>\n  </property>\n  <property name="windowTitle">\n   <string>Bulk Fix Invalid Country</string>\n  </property>\n  <layout class="QHBoxLayout" name="horizontalLayout">\n   <item>\n    <layout class="QFormLayout" name="formLayout">\n     <item row="0" column="0">\n      <widget class="QLabel" name="_oldCountryLit">\n       <property name="text">\n        <string>Replace all instances of this:</string>\n       </property>\n       <property name="buddy">\n        <cstring>_oldCountry</cstring>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="0">\n      <widget class="QLabel" name="_newCountryLit">\n       <property name="text">\n        <string>with this country:</string>\n       </property>\n       <property name="buddy">\n        <cstring>_newCountry</cstring>\n       </property>\n      </widget>\n     </item>\n     <item row="1" column="1">\n      <widget class="XComboBox" name="_newCountry">\n       <property name="allowNull">\n        <bool>true</bool>\n       </property>\n       <property name="type">\n        <enum>XComboBox::Countries</enum>\n       </property>\n      </widget>\n     </item>\n     <item row="0" column="1">\n      <widget class="XComboBox" name="_oldCountry"/>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class="QDialogButtonBox" name="_buttons">\n     <property name="orientation">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name="standardButtons">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::SaveAll</set>\n     </property>\n     <property name="centerButtons">\n      <bool>false</bool>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>XComboBox</class>\n   <extends>QComboBox</extends>\n   <header>xcombobox.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n	
\.



--
-- Data for Name: acalitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY acalitem (acalitem_id, acalitem_calhead_id, acalitem_periodstart, acalitem_periodlength, acalitem_name) FROM stdin;
\.


--
-- Data for Name: accnt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY accnt (accnt_id, accnt_number, accnt_descrip, accnt_comments, accnt_profit, accnt_sub, accnt_type, accnt_extref, accnt_company, accnt_forwardupdate, accnt_subaccnttype_code, accnt_curr_id, accnt_active, accnt_name) FROM stdin;
\.


--
-- Name: accnt_accnt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('accnt_accnt_id_seq', 83, true);


--
-- Data for Name: addr; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY addr (addr_id, addr_active, addr_line1, addr_line2, addr_line3, addr_city, addr_state, addr_postalcode, addr_country, addr_notes, addr_number) FROM stdin;
\.


--
-- Name: addr_addr_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('addr_addr_id_seq', 1, false);


--
-- Data for Name: alarm; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY alarm (alarm_id, alarm_number, alarm_event, alarm_email, alarm_sysmsg, alarm_trigger, alarm_time, alarm_time_offset, alarm_time_qualifier, alarm_creator, alarm_event_recipient, alarm_email_recipient, alarm_sysmsg_recipient, alarm_source, alarm_source_id) FROM stdin;
\.


--
-- Name: alarm_alarm_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('alarm_alarm_id_seq', 1, false);


--
-- Data for Name: apaccnt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apaccnt (apaccnt_id, apaccnt_vendtype_id, apaccnt_vendtype, apaccnt_ap_accnt_id, apaccnt_prepaid_accnt_id, apaccnt_discount_accnt_id) FROM stdin;
\.


--
-- Name: apaccnt_apaccnt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('apaccnt_apaccnt_id_seq', 19, true);


--
-- Data for Name: apapply; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apapply (apapply_id, apapply_vend_id, apapply_postdate, apapply_username, apapply_source_apopen_id, apapply_source_doctype, apapply_source_docnumber, apapply_target_apopen_id, apapply_target_doctype, apapply_target_docnumber, apapply_journalnumber, apapply_amount, apapply_curr_id, apapply_target_paid, apapply_checkhead_id) FROM stdin;
\.


--
-- Name: apapply_apapply_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('apapply_apapply_id_seq', 1, false);


--
-- Data for Name: apcreditapply; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apcreditapply (apcreditapply_id, apcreditapply_source_apopen_id, apcreditapply_target_apopen_id, apcreditapply_amount, apcreditapply_curr_id) FROM stdin;
\.


--
-- Name: apcreditapply_apcreditapply_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('apcreditapply_apcreditapply_id_seq', 1, false);


--
-- Data for Name: apopen; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apopen (apopen_id, apopen_docdate, apopen_duedate, apopen_terms_id, apopen_vend_id, apopen_doctype, apopen_docnumber, apopen_amount, apopen_notes, apopen_posted, apopen_reference, apopen_invcnumber, apopen_ponumber, apopen_journalnumber, apopen_paid, apopen_open, apopen_username, apopen_discount, apopen_accnt_id, apopen_curr_id, apopen_closedate, apopen_distdate, apopen_void, apopen_curr_rate, apopen_discountable_amount, apopen_status) FROM stdin;
\.


--
-- Name: apopen_apopen_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('apopen_apopen_id_seq', 70, true);


--
-- Data for Name: apopentax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apopentax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: apselect; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY apselect (apselect_id, apselect_apopen_id, apselect_amount, apselect_bankaccnt_id, apselect_curr_id, apselect_date, apselect_discount) FROM stdin;
\.


--
-- Name: apselect_apselect_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('apselect_apselect_id_seq', 501, true);


--
-- Data for Name: araccnt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY araccnt (araccnt_id, araccnt_custtype_id, araccnt_custtype, araccnt_freight_accnt_id, araccnt_ar_accnt_id, araccnt_prepaid_accnt_id, araccnt_deferred_accnt_id, araccnt_discount_accnt_id) FROM stdin;
\.


--
-- Name: araccnt_araccnt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('araccnt_araccnt_id_seq', 37, true);


--
-- Data for Name: arapply; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY arapply (arapply_id, arapply_postdate, arapply_cust_id, arapply_source_doctype, arapply_source_docnumber, arapply_target_doctype, arapply_target_docnumber, arapply_fundstype, arapply_refnumber, arapply_applied, arapply_closed, arapply_journalnumber, arapply_source_aropen_id, arapply_target_aropen_id, arapply_username, arapply_curr_id, arapply_distdate, arapply_target_paid, arapply_reftype, arapply_ref_id) FROM stdin;
\.


--
-- Name: arapply_arapply_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('arapply_arapply_id_seq', 1, false);


--
-- Data for Name: arcreditapply; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY arcreditapply (arcreditapply_id, arcreditapply_source_aropen_id, arcreditapply_target_aropen_id, arcreditapply_amount, arcreditapply_curr_id, arcreditapply_reftype, arcreditapply_ref_id) FROM stdin;
\.


--
-- Name: arcreditapply_arcreditapply_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('arcreditapply_arcreditapply_id_seq', 1, false);


--
-- Data for Name: aropen; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY aropen (aropen_id, aropen_docdate, aropen_duedate, aropen_terms_id, aropen_cust_id, aropen_doctype, aropen_docnumber, aropen_applyto, aropen_ponumber, aropen_amount, aropen_notes, aropen_posted, aropen_salesrep_id, aropen_commission_due, aropen_commission_paid, aropen_ordernumber, aropen_cobmisc_id, aropen_journalnumber, aropen_paid, aropen_open, aropen_username, aropen_rsncode_id, aropen_salescat_id, aropen_accnt_id, aropen_curr_id, aropen_closedate, aropen_distdate, aropen_curr_rate, aropen_discount, aropen_fincharg_date, aropen_fincharg_amount) FROM stdin;
\.


--
-- Name: aropen_aropen_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('aropen_aropen_id_seq', 292, true);


--
-- Data for Name: aropenalloc; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY aropenalloc (aropenalloc_aropen_id, aropenalloc_doctype, aropenalloc_doc_id, aropenalloc_amount, aropenalloc_curr_id) FROM stdin;
\.


--
-- Data for Name: aropentax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY aropentax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: asohist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY asohist (asohist_id, asohist_cust_id, asohist_itemsite_id, asohist_shipdate, asohist_invcdate, asohist_duedate, asohist_promisedate, asohist_ordernumber, asohist_invcnumber, asohist_qtyshipped, asohist_unitprice, asohist_unitcost, asohist_billtoname, asohist_billtoaddress1, asohist_billtoaddress2, asohist_billtoaddress3, asohist_billtocity, asohist_billtostate, asohist_billtozip, asohist_shiptoname, asohist_shiptoaddress1, asohist_shiptoaddress2, asohist_shiptoaddress3, asohist_shiptocity, asohist_shiptostate, asohist_shiptozip, asohist_shipto_id, asohist_shipvia, asohist_salesrep_id, asohist_misc_type, asohist_misc_descrip, asohist_misc_id, asohist_commission, asohist_commissionpaid, asohist_doctype, asohist_orderdate, asohist_imported, asohist_ponumber, asohist_curr_id, asohist_taxtype_id, asohist_taxzone_id) FROM stdin;
\.


--
-- Name: asohist_asohist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('asohist_asohist_id_seq', 1, false);


--
-- Data for Name: asohisttax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY asohisttax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: atlasmap; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY atlasmap (atlasmap_id, atlasmap_name, atlasmap_filter, atlasmap_filtertype, atlasmap_atlas, atlasmap_map, atlasmap_headerline) FROM stdin;
\.


--
-- Name: atlasmap_atlasmap_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('atlasmap_atlasmap_id_seq', 1, false);


--
-- Data for Name: backup_usr; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY backup_usr (usr_id, usr_username, usr_propername, usr_passwd, usr_locale_id, usr_initials, usr_agent, usr_active, usr_email, usr_dept_id, usr_shift_id, usr_window) FROM stdin;
1	mfgadmin	OpenMFG Administrator	\N	3	ADMIN	t	t	admin@example.com	\N	\N	
2	admin	Administrator		3	ADMIN	t	t	admin@example.com	\N	\N	\N
\.


--
-- Data for Name: bankaccnt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankaccnt (bankaccnt_id, bankaccnt_name, bankaccnt_descrip, bankaccnt_bankname, bankaccnt_accntnumber, bankaccnt_ar, bankaccnt_ap, bankaccnt_nextchknum, bankaccnt_type, bankaccnt_accnt_id, bankaccnt_check_form_id, bankaccnt_userec, bankaccnt_rec_accnt_id, bankaccnt_curr_id, bankaccnt_notes, bankaccnt_routing, bankaccnt_ach_enabled, bankaccnt_ach_origin, bankaccnt_ach_genchecknum, bankaccnt_ach_leadtime, bankaccnt_ach_lastdate, bankaccnt_ach_lastfileid, bankaccnt_ach_origintype, bankaccnt_ach_originname, bankaccnt_ach_desttype, bankaccnt_ach_fed_dest, bankaccnt_ach_destname, bankaccnt_ach_dest, bankaccnt_prnt_check) FROM stdin;
\.


--
-- Name: bankaccnt_bankaccnt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankaccnt_bankaccnt_id_seq', 12, true);


--
-- Data for Name: bankadj; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankadj (bankadj_id, bankadj_bankaccnt_id, bankadj_bankadjtype_id, bankadj_created, bankadj_username, bankadj_date, bankadj_docnumber, bankadj_amount, bankadj_notes, bankadj_sequence, bankadj_posted, bankadj_curr_id, bankadj_curr_rate) FROM stdin;
\.


--
-- Name: bankadj_bankadj_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankadj_bankadj_id_seq', 1, false);


--
-- Data for Name: bankadjtype; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankadjtype (bankadjtype_id, bankadjtype_name, bankadjtype_descrip, bankadjtype_accnt_id, bankadjtype_iscredit) FROM stdin;
\.


--
-- Name: bankadjtype_bankadjtype_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankadjtype_bankadjtype_id_seq', 1, false);


--
-- Data for Name: bankrec; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankrec (bankrec_id, bankrec_created, bankrec_username, bankrec_bankaccnt_id, bankrec_opendate, bankrec_enddate, bankrec_openbal, bankrec_endbal, bankrec_posted, bankrec_postdate) FROM stdin;
\.


--
-- Name: bankrec_bankrec_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankrec_bankrec_id_seq', 1, false);


--
-- Data for Name: bankrecimport; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankrecimport (bankrecimport_id, bankrecimport_reference, bankrecimport_descrip, bankrecimport_comment, bankrecimport_debit_amount, bankrecimport_credit_amount, bankrecimport_effdate, bankrecimport_curr_rate) FROM stdin;
\.


--
-- Name: bankrecimport_bankrecimport_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankrecimport_bankrecimport_id_seq', 1, false);


--
-- Data for Name: bankrecitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bankrecitem (bankrecitem_id, bankrecitem_bankrec_id, bankrecitem_source, bankrecitem_source_id, bankrecitem_cleared, bankrecitem_curr_rate, bankrecitem_amount, bankrecitem_effdate) FROM stdin;
\.


--
-- Name: bankrecitem_bankrecitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bankrecitem_bankrecitem_id_seq', 1, false);


--
-- Data for Name: bomhead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bomhead (bomhead_id, bomhead_item_id, bomhead_serial, bomhead_docnum, bomhead_revision, bomhead_revisiondate, bomhead_batchsize, bomhead_requiredqtyper, bomhead_rev_id) FROM stdin;
\.


--
-- Name: bomhead_bomhead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bomhead_bomhead_id_seq', 54, true);


--
-- Data for Name: bomitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bomitem (bomitem_id, bomitem_parent_item_id, bomitem_seqnumber, bomitem_item_id, bomitem_qtyper, bomitem_scrap, bomitem_status, bomitem_effective, bomitem_expires, bomitem_createwo, bomitem_issuemethod, bomitem_schedatwooper, bomitem_ecn, bomitem_moddate, bomitem_subtype, bomitem_uom_id, bomitem_rev_id, bomitem_booitem_seq_id, bomitem_char_id, bomitem_value, bomitem_notes, bomitem_ref, bomitem_qtyfxd, bomitem_issuewo) FROM stdin;
\.


--
-- Name: bomitem_bomitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bomitem_bomitem_id_seq', 167, true);


--
-- Data for Name: bomitemcost; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bomitemcost (bomitemcost_id, bomitemcost_bomitem_id, bomitemcost_costelem_id, bomitemcost_lowlevel, bomitemcost_stdcost, bomitemcost_posted, bomitemcost_actcost, bomitemcost_updated, bomitemcost_curr_id) FROM stdin;
\.


--
-- Name: bomitemcost_bomitemcost_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bomitemcost_bomitemcost_id_seq', 1, false);


--
-- Data for Name: bomitemsub; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bomitemsub (bomitemsub_id, bomitemsub_bomitem_id, bomitemsub_item_id, bomitemsub_uomratio, bomitemsub_rank) FROM stdin;
\.


--
-- Name: bomitemsub_bomitemsub_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bomitemsub_bomitemsub_id_seq', 1, false);


--
-- Data for Name: bomwork; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY bomwork (bomwork_id, bomwork_set_id, bomwork_seqnumber, bomwork_item_id, bomwork_item_type, bomwork_qtyper, bomwork_scrap, bomwork_status, bomwork_level, bomwork_parent_id, bomwork_effective, bomwork_expires, bomwork_stdunitcost, bomwork_actunitcost, bomwork_parent_seqnumber, bomwork_createwo, bomwork_issuemethod, bomwork_char_id, bomwork_value, bomwork_notes, bomwork_ref, bomwork_bomitem_id, bomwork_ecn, bomwork_qtyfxd, bomwork_qtyreq) FROM stdin;
\.


--
-- Name: bomwork_bomwork_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('bomwork_bomwork_id_seq', 1, false);


--
-- Data for Name: budghead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY budghead (budghead_id, budghead_name, budghead_descrip) FROM stdin;
1	Default	Default budget for conversion
\.


--
-- Name: budghead_budghead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('budghead_budghead_id_seq', 2, true);


--
-- Data for Name: budgitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY budgitem (budgitem_id, budgitem_budghead_id, budgitem_period_id, budgitem_accnt_id, budgitem_amount) FROM stdin;
\.


--
-- Name: budgitem_budgitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('budgitem_budgitem_id_seq', 1, true);


--
-- Data for Name: calhead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY calhead (calhead_id, calhead_type, calhead_name, calhead_descrip, calhead_origin) FROM stdin;
\.


--
-- Name: calhead_calhead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('calhead_calhead_id_seq', 46, true);


--
-- Name: carrier_carrier_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('carrier_carrier_id_seq', 15, true);


--
-- Data for Name: cashrcpt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cashrcpt (cashrcpt_id, cashrcpt_cust_id, cashrcpt_amount, cashrcpt_fundstype, cashrcpt_docnumber, cashrcpt_bankaccnt_id, cashrcpt_notes, cashrcpt_distdate, cashrcpt_salescat_id, cashrcpt_curr_id, cashrcpt_usecustdeposit, cashrcpt_void, cashrcpt_number, cashrcpt_docdate, cashrcpt_posted, cashrcpt_posteddate, cashrcpt_postedby, cashrcpt_applydate, cashrcpt_discount, cashrcpt_curr_rate, cashrcpt_alt_curr_rate) FROM stdin;
\.


--
-- Name: cashrcpt_cashrcpt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cashrcpt_cashrcpt_id_seq', 112, true);


--
-- Data for Name: cashrcptitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cashrcptitem (cashrcptitem_id, cashrcptitem_cashrcpt_id, cashrcptitem_aropen_id, cashrcptitem_amount, cashrcptitem_discount, cashrcptitem_applied) FROM stdin;
\.


--
-- Name: cashrcptitem_cashrcptitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cashrcptitem_cashrcptitem_id_seq', 170, true);


--
-- Data for Name: cashrcptmisc; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cashrcptmisc (cashrcptmisc_id, cashrcptmisc_cashrcpt_id, cashrcptmisc_accnt_id, cashrcptmisc_amount, cashrcptmisc_notes) FROM stdin;
\.


--
-- Name: cashrcptmisc_cashrcptmisc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cashrcptmisc_cashrcptmisc_id_seq', 26, true);


--
-- Data for Name: ccard; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ccard (ccard_id, ccard_seq, ccard_cust_id, ccard_active, ccard_name, ccard_address1, ccard_address2, ccard_city, ccard_state, ccard_zip, ccard_country, ccard_number, ccard_debit, ccard_month_expired, ccard_year_expired, ccard_type, ccard_date_added, ccard_lastupdated, ccard_added_by_username, ccard_last_updated_by_username) FROM stdin;
\.


--
-- Name: ccard_ccard_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ccard_ccard_id_seq', 1, false);


--
-- Data for Name: ccardaud; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ccardaud (ccardaud_id, ccardaud_ccard_id, ccardaud_ccard_seq_old, ccardaud_ccard_seq_new, ccardaud_ccard_cust_id_old, ccardaud_ccard_cust_id_new, ccardaud_ccard_active_old, ccardaud_ccard_active_new, ccardaud_ccard_name_old, ccardaud_ccard_name_new, ccardaud_ccard_address1_old, ccardaud_ccard_address1_new, ccardaud_ccard_address2_old, ccardaud_ccard_address2_new, ccardaud_ccard_city_old, ccardaud_ccard_city_new, ccardaud_ccard_state_old, ccardaud_ccard_state_new, ccardaud_ccard_zip_old, ccardaud_ccard_zip_new, ccardaud_ccard_country_old, ccardaud_ccard_country_new, ccardaud_ccard_number_old, ccardaud_ccard_number_new, ccardaud_ccard_debit_old, ccardaud_ccard_debit_new, ccardaud_ccard_month_expired_old, ccardaud_ccard_month_expired_new, ccardaud_ccard_year_expired_old, ccardaud_ccard_year_expired_new, ccardaud_ccard_type_old, ccardaud_ccard_type_new, ccardaud_ccard_last_updated, ccardaud_ccard_last_updated_by_username) FROM stdin;
\.


--
-- Name: ccardaud_ccardaud_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ccardaud_ccardaud_id_seq', 1, false);


--
-- Data for Name: ccbank; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ccbank (ccbank_id, ccbank_ccard_type, ccbank_bankaccnt_id) FROM stdin;
1	A	\N
2	D	\N
3	M	\N
4	P	\N
5	V	\N
\.


--
-- Name: ccbank_ccbank_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ccbank_ccbank_id_seq', 5, true);


--
-- Data for Name: ccpay; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ccpay (ccpay_id, ccpay_ccard_id, ccpay_cust_id, ccpay_amount, ccpay_auth, ccpay_status, ccpay_type, ccpay_auth_charge, ccpay_order_number, ccpay_order_number_seq, ccpay_r_avs, ccpay_r_ordernum, ccpay_r_error, ccpay_r_approved, ccpay_r_code, ccpay_r_message, ccpay_yp_r_time, ccpay_r_ref, ccpay_yp_r_tdate, ccpay_r_tax, ccpay_r_shipping, ccpay_yp_r_score, ccpay_transaction_datetime, ccpay_by_username, ccpay_curr_id, ccpay_ccpay_id, ccpay_card_pan_trunc, ccpay_card_type) FROM stdin;
\.


--
-- Name: ccpay_ccpay_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ccpay_ccpay_id_seq', 1, false);


--
-- Data for Name: char; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY "char" (char_id, char_name, char_items, char_options, char_attributes, char_lotserial, char_notes, char_customers, char_crmaccounts, char_addresses, char_contacts, char_opportunity, char_employees, char_mask, char_validator, char_incidents, char_type, char_order, char_search, char_quotes, char_salesorders, char_invoices, char_vendors, char_purchaseorders, char_vouchers, char_projects, char_tasks) FROM stdin;
\.


--
-- Name: char_char_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('char_char_id_seq', 11, true);


--
-- Data for Name: charass; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY charass (charass_id, charass_target_type, charass_target_id, charass_char_id, charass_value, charass_default, charass_price) FROM stdin;
\.


--
-- Name: charass_charass_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('charass_charass_id_seq', 1, false);


--
-- Data for Name: charopt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY charopt (charopt_id, charopt_char_id, charopt_value, charopt_order) FROM stdin;
\.


--
-- Name: charopt_charopt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('charopt_charopt_id_seq', 1, false);


--
-- Data for Name: charuse; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY charuse (charuse_id, charuse_char_id, charuse_target_type, charuse_created, charuse_last_modified) FROM stdin;
\.


--
-- Name: charuse_charuse_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('charuse_charuse_id_seq', 1, false);


--
-- Data for Name: checkhead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY checkhead (checkhead_id, checkhead_recip_id, checkhead_recip_type, checkhead_bankaccnt_id, checkhead_printed, checkhead_checkdate, checkhead_number, checkhead_amount, checkhead_void, checkhead_replaced, checkhead_posted, checkhead_rec, checkhead_misc, checkhead_expcat_id, checkhead_for, checkhead_notes, checkhead_journalnumber, checkhead_curr_id, checkhead_deleted, checkhead_ach_batch, checkhead_curr_rate, checkhead_alt_curr_rate) FROM stdin;
\.


--
-- Name: checkhead_checkhead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('checkhead_checkhead_id_seq', 1, false);


--
-- Data for Name: checkitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY checkitem (checkitem_id, checkitem_checkhead_id, checkitem_amount, checkitem_discount, checkitem_ponumber, checkitem_vouchernumber, checkitem_invcnumber, checkitem_apopen_id, checkitem_aropen_id, checkitem_docdate, checkitem_curr_id, checkitem_cmnumber, checkitem_ranumber, checkitem_curr_rate) FROM stdin;
\.


--
-- Name: checkitem_checkitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('checkitem_checkitem_id_seq', 1, false);


--
-- Data for Name: classcode; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY classcode (classcode_id, classcode_code, classcode_descrip, classcode_mfg, classcode_creator, classcode_created, classcode_modifier, classcode_modified, classcode_type) FROM stdin;
\.


--
-- Name: classcode_classcode_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('classcode_classcode_id_seq', 32, true);


--
-- Data for Name: cmd; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmd (cmd_id, cmd_module, cmd_title, cmd_descrip, cmd_privname, cmd_executable, cmd_name) FROM stdin;
\.


--
-- Name: cmd_cmd_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmd_cmd_id_seq', 6, true);


--
-- Data for Name: cmdarg; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmdarg (cmdarg_id, cmdarg_cmd_id, cmdarg_order, cmdarg_arg) FROM stdin;
\.


--
-- Name: cmdarg_cmdarg_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmdarg_cmdarg_id_seq', 6, true);


--
-- Data for Name: cmhead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmhead (cmhead_id, cmhead_number, cmhead_posted, cmhead_invcnumber, cmhead_custponumber, cmhead_cust_id, cmhead_docdate, cmhead_shipto_id, cmhead_shipto_name, cmhead_shipto_address1, cmhead_shipto_address2, cmhead_shipto_address3, cmhead_shipto_city, cmhead_shipto_state, cmhead_shipto_zipcode, cmhead_salesrep_id, cmhead_freight, cmhead_misc, cmhead_comments, cmhead_printed, cmhead_billtoname, cmhead_billtoaddress1, cmhead_billtoaddress2, cmhead_billtoaddress3, cmhead_billtocity, cmhead_billtostate, cmhead_billtozip, cmhead_hold, cmhead_commission, cmhead_misc_accnt_id, cmhead_misc_descrip, cmhead_rsncode_id, cmhead_curr_id, cmhead_freighttaxtype_id, cmhead_gldistdate, cmhead_billtocountry, cmhead_shipto_country, cmhead_rahead_id, cmhead_taxzone_id, cmhead_prj_id, cmhead_void, cmhead_saletype_id, cmhead_shipzone_id) FROM stdin;
\.


--
-- Name: cmhead_cmhead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmhead_cmhead_id_seq', 206, true);


--
-- Data for Name: cmheadtax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmheadtax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: cmitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmitem (cmitem_id, cmitem_cmhead_id, cmitem_linenumber, cmitem_itemsite_id, cmitem_qtycredit, cmitem_qtyreturned, cmitem_unitprice, cmitem_comments, cmitem_rsncode_id, cmitem_taxtype_id, cmitem_qty_uom_id, cmitem_qty_invuomratio, cmitem_price_uom_id, cmitem_price_invuomratio, cmitem_raitem_id, cmitem_updateinv) FROM stdin;
\.


--
-- Name: cmitem_cmitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmitem_cmitem_id_seq', 83, true);


--
-- Data for Name: cmitemtax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmitemtax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: cmnttype; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmnttype (cmnttype_id, cmnttype_name, cmnttype_descrip, cmnttype_usedin, cmnttype_sys, cmnttype_editable, cmnttype_order) FROM stdin;
1	General	General Comment	ICVPL	t	f	\N
2	ChangeLog	Change Log	ICVP	t	f	\N
3	Notes to Comment	Used by certain triggers to automatically create/update comment with content of notes.	\N	t	f	\N
\.


--
-- Name: cmnttype_cmnttype_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmnttype_cmnttype_id_seq', 3, true);


--
-- Data for Name: cmnttypesource; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cmnttypesource (cmnttypesource_id, cmnttypesource_cmnttype_id, cmnttypesource_source_id) FROM stdin;
76	1	1
77	2	1
78	1	2
79	2	2
80	1	3
81	2	3
82	1	4
83	2	4
84	1	5
85	2	5
86	1	6
87	2	6
88	1	7
89	2	7
90	1	8
91	2	8
92	1	9
93	2	9
94	1	10
95	2	10
96	1	11
97	2	11
98	1	12
99	2	12
100	1	13
101	2	13
102	1	14
103	2	14
104	1	15
105	2	15
106	1	16
107	2	16
108	1	17
109	2	17
110	1	18
111	2	18
112	1	19
113	2	19
114	1	20
115	2	20
116	1	21
117	2	21
118	1	22
119	2	22
120	1	23
121	2	23
122	1	24
123	2	24
124	1	25
125	2	25
126	1	26
127	2	26
128	1	27
129	2	27
130	1	28
131	2	28
132	1	29
133	2	29
134	1	30
135	2	30
136	1	31
137	2	31
138	1	32
139	2	32
140	1	33
141	2	33
142	1	34
143	2	34
144	3	12
\.


--
-- Name: cmnttypesource_cmnttypesource_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cmnttypesource_cmnttypesource_id_seq', 144, true);


--
-- Data for Name: cntct; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntct (cntct_id, cntct_crmacct_id, cntct_addr_id, cntct_first_name, cntct_last_name, cntct_honorific, cntct_initials, cntct_active, cntct_phone, cntct_phone2, cntct_fax, cntct_email, cntct_webaddr, cntct_notes, cntct_title, cntct_number, cntct_middle, cntct_suffix, cntct_owner_username, cntct_name) FROM stdin;
\.


--
-- Name: cntct_cntct_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cntct_cntct_id_seq', 1, false);


--
-- Data for Name: cntctaddr; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntctaddr (cntctaddr_id, cntctaddr_cntct_id, cntctaddr_primary, cntctaddr_addr_id, cntctaddr_type) FROM stdin;
\.


--
-- Name: cntctaddr_cntctaddr_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cntctaddr_cntctaddr_id_seq', 1, false);


--
-- Data for Name: cntctdata; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntctdata (cntctdata_id, cntctdata_cntct_id, cntctdata_primary, cntctdata_text, cntctdata_type) FROM stdin;
\.


--
-- Name: cntctdata_cntctdata_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cntctdata_cntctdata_id_seq', 1, false);


--
-- Data for Name: cntcteml; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntcteml (cntcteml_id, cntcteml_cntct_id, cntcteml_primary, cntcteml_email) FROM stdin;
\.


--
-- Name: cntcteml_cntcteml_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cntcteml_cntcteml_id_seq', 1, false);


--
-- Data for Name: cntctmrgd; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntctmrgd (cntctmrgd_cntct_id, cntctmrgd_error) FROM stdin;
\.


--
-- Data for Name: cntctsel; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntctsel (cntctsel_cntct_id, cntctsel_target, cntctsel_mrg_crmacct_id, cntctsel_mrg_addr_id, cntctsel_mrg_first_name, cntctsel_mrg_last_name, cntctsel_mrg_honorific, cntctsel_mrg_initials, cntctsel_mrg_phone, cntctsel_mrg_phone2, cntctsel_mrg_fax, cntctsel_mrg_email, cntctsel_mrg_webaddr, cntctsel_mrg_notes, cntctsel_mrg_title, cntctsel_mrg_middle, cntctsel_mrg_suffix, cntctsel_mrg_owner_username) FROM stdin;
\.


--
-- Data for Name: cntslip; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cntslip (cntslip_id, cntslip_cnttag_id, cntslip_entered, cntslip_posted, cntslip_number, cntslip_qty, cntslip_comments, cntslip_location_id, cntslip_lotserial, cntslip_lotserial_expiration, cntslip_lotserial_warrpurc, cntslip_username) FROM stdin;
\.


--
-- Name: cntslip_cntslip_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cntslip_cntslip_id_seq', 97, true);


--
-- Data for Name: cobill; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cobill (cobill_id, cobill_coitem_id, cobill_selectdate, cobill_qty, cobill_invcnum, cobill_toclose, cobill_cobmisc_id, cobill_select_username, cobill_invcitem_id, cobill_taxtype_id) FROM stdin;
\.


--
-- Name: cobill_cobill_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cobill_cobill_id_seq', 528, true);


--
-- Data for Name: cobilltax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cobilltax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: cobmisc; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cobmisc (cobmisc_id, cobmisc_cohead_id, cobmisc_shipvia, cobmisc_freight, cobmisc_misc, cobmisc_payment, cobmisc_paymentref, cobmisc_notes, cobmisc_shipdate, cobmisc_invcnumber, cobmisc_invcdate, cobmisc_posted, cobmisc_misc_accnt_id, cobmisc_misc_descrip, cobmisc_closeorder, cobmisc_curr_id, cobmisc_invchead_id, cobmisc_taxzone_id, cobmisc_taxtype_id) FROM stdin;
\.


--
-- Name: cobmisc_cobmisc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cobmisc_cobmisc_id_seq', 204, true);


--
-- Data for Name: cobmisctax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cobmisctax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: cohead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cohead (cohead_id, cohead_number, cohead_cust_id, cohead_custponumber, cohead_type, cohead_orderdate, cohead_warehous_id, cohead_shipto_id, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, cohead_shiptoaddress4, cohead_shiptoaddress5, cohead_salesrep_id, cohead_terms_id, cohead_fob, cohead_shipvia, cohead_shiptocity, cohead_shiptostate, cohead_shiptozipcode, cohead_freight, cohead_misc, cohead_imported, cohead_ordercomments, cohead_shipcomments, cohead_shiptophone, cohead_shipchrg_id, cohead_shipform_id, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, cohead_billtocity, cohead_billtostate, cohead_billtozipcode, cohead_misc_accnt_id, cohead_misc_descrip, cohead_commission, cohead_miscdate, cohead_holdtype, cohead_packdate, cohead_prj_id, cohead_wasquote, cohead_lastupdated, cohead_shipcomplete, cohead_created, cohead_creator, cohead_quote_number, cohead_billtocountry, cohead_shiptocountry, cohead_curr_id, cohead_calcfreight, cohead_shipto_cntct_id, cohead_shipto_cntct_honorific, cohead_shipto_cntct_first_name, cohead_shipto_cntct_middle, cohead_shipto_cntct_last_name, cohead_shipto_cntct_suffix, cohead_shipto_cntct_phone, cohead_shipto_cntct_title, cohead_shipto_cntct_fax, cohead_shipto_cntct_email, cohead_billto_cntct_id, cohead_billto_cntct_honorific, cohead_billto_cntct_first_name, cohead_billto_cntct_middle, cohead_billto_cntct_last_name, cohead_billto_cntct_suffix, cohead_billto_cntct_phone, cohead_billto_cntct_title, cohead_billto_cntct_fax, cohead_billto_cntct_email, cohead_taxzone_id, cohead_taxtype_id, cohead_ophead_id, cohead_status, cohead_saletype_id, cohead_shipzone_id) FROM stdin;
\.


--
-- Name: cohead_cohead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cohead_cohead_id_seq', 2952, true);


--
-- Data for Name: cohist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cohist (cohist_id, cohist_cust_id, cohist_itemsite_id, cohist_shipdate, cohist_shipvia, cohist_ordernumber, cohist_orderdate, cohist_invcnumber, cohist_invcdate, cohist_qtyshipped, cohist_unitprice, cohist_shipto_id, cohist_salesrep_id, cohist_duedate, cohist_imported, cohist_billtoname, cohist_billtoaddress1, cohist_billtoaddress2, cohist_billtoaddress3, cohist_billtocity, cohist_billtostate, cohist_billtozip, cohist_shiptoname, cohist_shiptoaddress1, cohist_shiptoaddress2, cohist_shiptoaddress3, cohist_shiptocity, cohist_shiptostate, cohist_shiptozip, cohist_commission, cohist_commissionpaid, cohist_unitcost, cohist_misc_type, cohist_misc_descrip, cohist_misc_id, cohist_doctype, cohist_promisedate, cohist_ponumber, cohist_curr_id, cohist_sequence, cohist_taxtype_id, cohist_taxzone_id, cohist_cohead_ccpay_id, cohist_saletype_id, cohist_shipzone_id) FROM stdin;
\.


--
-- Name: cohist_cohist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cohist_cohist_id_seq', 493, true);


--
-- Data for Name: cohisttax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY cohisttax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: coitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY coitem (coitem_id, coitem_cohead_id, coitem_linenumber, coitem_itemsite_id, coitem_status, coitem_scheddate, coitem_promdate, coitem_qtyord, coitem_unitcost, coitem_price, coitem_custprice, coitem_qtyshipped, coitem_order_id, coitem_memo, coitem_imported, coitem_qtyreturned, coitem_closedate, coitem_custpn, coitem_order_type, coitem_close_username, coitem_lastupdated, coitem_substitute_item_id, coitem_created, coitem_creator, coitem_prcost, coitem_qty_uom_id, coitem_qty_invuomratio, coitem_price_uom_id, coitem_price_invuomratio, coitem_warranty, coitem_cos_accnt_id, coitem_qtyreserved, coitem_subnumber, coitem_firm, coitem_taxtype_id, coitem_rev_accnt_id, coitem_pricemode) FROM stdin;
\.


--
-- Name: coitem_coitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('coitem_coitem_id_seq', 564, true);


--
-- Data for Name: comment; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY comment (comment_id, comment_source_id, comment_date, comment_user, comment_text, comment_cmnttype_id, comment_source, comment_public) FROM stdin;
39	1	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
40	2	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
41	3	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
42	4	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
43	5	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
44	6	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
45	7	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
46	8	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
47	9	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
48	10	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
49	11	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
50	12	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
51	13	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
52	14	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
53	15	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
54	16	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
55	17	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
56	18	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
57	19	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
58	20	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
59	21	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
60	22	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
61	23	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
62	24	2011-08-19 15:12:05.633058+00	admin	Created by admin	2	CRMA	f
\.


--
-- Name: comment_comment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('comment_comment_id_seq', 62, true);


--
-- Data for Name: company; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY company (company_id, company_number, company_descrip, company_external, company_server, company_port, company_database, company_curr_id, company_yearend_accnt_id, company_gainloss_accnt_id, company_dscrp_accnt_id, company_unrlzgainloss_accnt_id, company_unassigned_accnt_id) FROM stdin;
\.


--
-- Name: company_company_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('company_company_id_seq', 1, false);


--
-- Data for Name: contrct; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY contrct (contrct_id, contrct_number, contrct_vend_id, contrct_descrip, contrct_effective, contrct_expires, contrct_note) FROM stdin;
\.


--
-- Name: contrct_contrct_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('contrct_contrct_id_seq', 1, false);


--
-- Name: coship_coship_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('coship_coship_id_seq', 441, true);


--
-- Name: cosmisc_cosmisc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cosmisc_cosmisc_id_seq', 202, true);


--
-- Name: cosrc_cosrc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cosrc_cosrc_id_seq', 1, false);


--
-- Data for Name: costcat; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY costcat (costcat_id, costcat_code, costcat_descrip, costcat_asset_accnt_id, costcat_liability_accnt_id, costcat_adjustment_accnt_id, costcat_matusage_accnt_id, costcat_purchprice_accnt_id, costcat_laboroverhead_accnt_id, costcat_scrap_accnt_id, costcat_invcost_accnt_id, costcat_wip_accnt_id, costcat_shipasset_accnt_id, costcat_mfgscrap_accnt_id, costcat_transform_accnt_id, costcat_freight_accnt_id, costcat_toliability_accnt_id, costcat_exp_accnt_id) FROM stdin;
\.


--
-- Name: costcat_costcat_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('costcat_costcat_id_seq', 29, true);


--
-- Data for Name: costelem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY costelem (costelem_id, costelem_type, costelem_sys, costelem_po, costelem_active, costelem_exp_accnt_id, costelem_cost_item_id) FROM stdin;
3	Material	t	t	t	\N	-1
4	Direct Labor	t	f	t	\N	-1
5	Overhead	t	f	t	\N	-1
6	Machine Overhead	t	f	t	\N	-1
\.


--
-- Name: costelem_costelem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('costelem_costelem_id_seq', 20, true);


--
-- Data for Name: costhist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY costhist (costhist_id, costhist_item_id, costhist_costelem_id, costhist_type, costhist_date, costhist_oldcost, costhist_newcost, costhist_lowlevel, costhist_oldcurr_id, costhist_newcurr_id, costhist_username) FROM stdin;
\.


--
-- Name: costhist_costhist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('costhist_costhist_id_seq', 992, true);


--
-- Data for Name: costupdate; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY costupdate (costupdate_item_id, costupdate_lowlevel_code, costupdate_item_type) FROM stdin;
\.


--
-- Data for Name: country; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY country (country_id, country_abbr, country_name, country_curr_abbr, country_curr_name, country_curr_number, country_curr_symbol, country_qt_number) FROM stdin;
214	\N	\N	XTS	Code reserved for testing	963	\N	\N
5	AD	Andorra	EUR	Euro	978	â¬	5
228	AE	United Arab Emirates	AED	UAE Dirham	784	\N	223
1	AF	Afghanistan	AFN	Afghani	971	\N	1
9	AG	Antigua And Barbuda	XCD	East Caribbean Dollar	951	$	9
7	AI	Anguilla	XCD	East Caribbean Dollar	951	$	7
2	AL	Albania	ALL	Lek	8  	\N	2
11	AM	Armenia	AMD	Armenian Dram	51 	\N	11
154	AN	Netherlands Antilles	ANG	Netherlands Antillian Guilder	532	Æ	152
6	AO	Angola	AOA	Kwanza	973	\N	6
8	AQ	Antarctica	\N	\N	\N	\N	8
10	AR	Argentina	ARS	Argentine Peso	32 	$	10
4	AS	American Samoa	USD	US Dollar	840	$	4
14	AT	Austria	EUR	Euro	978	â¬	14
13	AU	Australia	AUD	Australian Dollar	36 	$	13
12	AW	Aruba	AWG	Aruban Guilder	533	Æ	12
15	AZ	Azerbaijan	AZN	Azerbaijanian Manat	944	\N	15
27	BA	Bosnia And Herzegovina	BAM	Convertible Marks	977	\N	27
19	BB	Barbados	BBD	Barbados Dollar	52 	$	19
18	BD	Bangladesh	BDT	Taka	50 	\N	18
21	BE	Belgium	EUR	Euro	978	â¬	21
35	BF	Burkina Faso	XOF	CFA Franc BCEAO	952	\N	34
34	BG	Bulgaria	BGN	Bulgarian Lev	975	\N	33
17	BH	Bahrain	BHD	Bahraini Dinar	48 	\N	17
36	BI	Burundi	BIF	Burundi Franc	108	\N	35
23	BJ	Benin	XOF	CFA Franc BCEAO	952	\N	23
24	BM	Bermuda	BMD	Bermudian Dollar	60 	$	24
33	BN	Brunei Darussalam	BND	Brunei Dollar	96 	$	32
26	BO	Bolivia	BOB	Boliviano	68 	$	26
30	BR	Brazil	BRL	Brazilian Real	986	R$	30
16	BS	Bahamas	BSD	Bahamian Dollar	44 	$	16
25	BT	Bhutan	BTN	Ngultrum	64 	\N	25
29	BV	Bouvet Island	NOK	Norwegian Krone	578	\N	29
28	BW	Botswana	BWP	Pula	72 	\N	28
20	BY	Belarus	BYR	Belarussian Ruble	974	\N	20
22	BZ	Belize	BZD	Belize Dollar	84 	$	22
39	CA	Canada	CAD	Canadian Dollar	124	$	38
47	CC	Cocos (Keeling) Islands	AUD	Australian Dollar	36 	$	46
51	CD	Congo, The Democratic Republic Of	CDF	Franc Congolais	976	\N	49
42	CF	Central African Republic	XAF	CFA Franc BEAC	950	\N	41
50	CG	Congo	XAF	CFA Franc BEAC	950	\N	50
209	CH	Switzerland	CHF	Swiss Franc	756	\N	206
107	CI	Ivory Coast	XOF	CFA Frank BCEA	952	\N	53
52	CK	Cook Islands	NZD	New Zealand Dollar	554	$	51
44	CL	Chile	CLP	Chilean Peso	152	$	43
38	CM	Cameroon	XAF	CFA Franc BEAC	950	\N	37
45	CN	China	CNY	Yuan Renminbi	156	\N	44
48	CO	Colombia	COP	Colombian Peso	170	â±	47
53	CR	Costa Rica	CRC	Costa Rican Colon	188	â¡	52
55	CU	Cuba	CUP	Cuban Peso	192	â±	55
40	CV	Cape Verde	CVE	Cape Verde Escudo	132	\N	39
46	CX	Christmas Island	AUD	Australian Dollar	36 	$	45
56	CY	Cyprus	CYP	Cyprus Pound	196	Â£	56
57	CZ	Czech Republic	CZK	Czech Koruna	203	\N	57
81	DE	Germany	EUR	Euro	978	â¬	82
59	DJ	Djibouti	DJF	Djibouti Franc	262	\N	59
58	DK	Denmark	DKK	Danish Krone	208	kr	58
60	DM	Dominica	XCD	East Caribbean Dollar	951	$	60
61	DO	Dominican Republic	DOP	Dominican Peso	214	â±	61
3	DZ	Algeria	DZD	Algerian Dinar	12 	\N	3
63	EC	Ecuador	USD	US Dollar	840	$	63
68	EE	Estonia	EEK	Kroon	233	\N	68
64	EG	Egypt	EGP	Egyptian Pound	818	Â£	64
239	EH	Western Sahara	MAD	Moroccan Dirham	504	\N	236
67	ER	Eritrea	ERN	Nakfa	232	\N	67
202	ES	Spain	EUR	Euro	978	â¬	197
69	ET	Ethiopia	ETB	Ethiopian Birr	230	\N	69
73	FI	Finland	EUR	Euro	978	â¬	73
72	FJ	Fiji	FJD	Fiji Dollar	242	$	72
70	FK	Falkland Islands (Malvinas)	FKP	Falkland Islands Pound	238	Â£	70
141	FM	Micronesia, Federated States Of	USD	US Dollar	840	$	140
71	FO	Faroe Islands	DKK	Danish Krone	208	\N	71
74	FR	France	EUR	Euro	978	â¬	74
78	GA	Gabon	XAF	CFA Franc BEAC	950	\N	79
86	GD	Grenada	XCD	East Caribbean Dollar	951	$	87
80	GE	Georgia	GEL	Lari	981	\N	81
75	GF	French Guiana	EUR	Euro	978	â¬	76
82	GH	Ghana	GHC	Cedi	288	\N	83
83	GI	Gibraltar	GIP	Gibraltar Pound	292	Â£	84
85	GL	Greenland	DKK	Danish Krone	208	\N	86
79	GM	Gambia	GMD	Dalasi	270	\N	80
90	GN	Guinea	GNF	Guinea Franc	324	\N	91
87	GP	Guadeloupe	EUR	Euro	978	â¬	88
66	GQ	Equatorial Guinea	XAF	CFA Franc BEAC	950	\N	66
84	GR	Greece	EUR	Euro	978	â¬	85
201	GS	South Georgia And The South Sandwich Islands 	GBP	Pound Sterling	826	\N	196
89	GT	Guatemala	GTQ	Quetzal	320	\N	90
88	GU	Guam	USD	US Dollar	840	$	89
91	GW	Guinea-Bissau	XOF	CFA Franc BCEAO	952	\N	92
92	GY	Guyana	GYD	Guyana Dollar	328	$	93
97	HK	Hong Kong	HKD	Hong Kong Dollar	344	$	97
94	HM	Heard Island And Mcdonald Islands	AUD	Australian Dollar	36 	$	95
96	HN	Honduras	HNL	Lempira	340	\N	96
54	HR	Croatia	HRK	Croatian Kuna	191	\N	54
93	HT	Haiti	HTG	Gourde	332	\N	94
98	HU	Hungary	HUF	Forint	348	\N	98
101	ID	Indonesia	IDR	Indonesia Rupiah	360	\N	101
104	IE	Ireland	EUR	Euro	978	â¬	104
105	IL	Israel	ILS	New Israeli Sheqel	376	âª	105
100	IN	India	INR	Indian Rupee	356	â¨	100
31	IO	British Indian Ocean Territory	USD	US Dollar	840	$	31
103	IQ	Iraq	IQD	Iraqi Dinar	368	\N	103
102	IR	Iran	IRR	Iranian Rial	364	ï·¼	102
99	IS	Iceland	ISK	Iceland Krona	352	\N	99
106	IT	Italy	EUR	Euro	978	â¬	106
108	JM	Jamaica	JMD	Jamaican Dollar	388	$	107
110	JO	Jordan	JOD	Jordanian Dinar	400	\N	109
109	JP	Japan	JPY	Yen	392	Â¥	108
112	KE	Kenya	KES	Kenyan Shilling	404	\N	111
117	KG	Kyrgyzstan	KGS	Som	417	\N	116
37	KH	Cambodia	KHR	Riel	116	á	36
113	KI	Kiribati	AUD	Australian Dollar	36 	$	112
49	KM	Comoros	KMF	Comoro Franc	174	\N	48
183	KN	Saint Kitts And Nevis	XCD	East Caribbean Dollar	951	$	180
114	KP	Korea, Democratic Peoples Republic Of	KPW	North Korean Won	408	â©	113
115	KR	Korea, Republic Of	KRW	South Korean Won	410	â©	114
116	KW	Kuwait	KWD	Kuwaiti Dinar	414	\N	115
41	KY	Cayman Islands	KYD	Cayman Islands Dollar	136	$	40
111	KZ	Kazakhstan	KZT	Tenge	398	\N	110
118	LA	Laos	LAK	Kip	418	â­	117
120	LB	Lebanon	LBP	Lebanese Pound	422	Â£	119
184	LC	Saint Lucia	XCD	East Caribbean Dollar	951	$	181
124	LI	Liechtenstein	CHF	Swiss Franc	756	\N	123
203	LK	Sri Lanka	LKR	Sri Lanka Rupee	144	à¯¹	198
122	LR	Liberia	LRD	Liberian Dollar	430	$	121
121	LS	Lesotho	LSL	Loti	426	\N	120
125	LT	Lithuania	LTL	Lithuanian Litas	440	\N	124
126	LU	Luxembourg	EUR	Euro	978	â¬	125
119	LV	Latvia	LVL	Latvian Lats	428	\N	118
123	LY	Libyan Arab Jamahiriya	LYD	Libyan Dinar	434	\N	122
147	MA	Morocco	MAD	Moroccan Dirham	504	\N	145
143	MC	Monaco	EUR	Euro	978	â¬	142
142	MD	Moldova	MDL	Moldovan Leu	498	\N	141
145	ME	Montenegro	EUR	Euro	978	â¬	241
129	MG	Madagascar	MGA	Malagascy Ariary	969	\N	128
135	MH	Marshall Islands	USD	US Dollar	840	$	134
128	MK	Macedonia, Former Yugoslav Republic Of	MKD	Denar	807	\N	127
133	ML	Mali	XOF	CFA Franc BCEAO	952	\N	132
149	MM	Myanmar	MMK	Kyat	104	\N	147
144	MN	Mongolia	MNT	Tugrik	496	â®	143
127	MO	Macao	MOP	Pataca	446	\N	126
162	MP	Northern Mariana Islands	USD	US Dollar	840	$	160
136	MQ	Martinique	EUR	Euro	978	â¬	135
137	MR	Mauritania	MRO	Ouguiya	478	\N	136
146	MS	Montserrat	XCD	East Caribbean Dollar	951	$	144
134	MT	Malta	MTL	Maltese Lira	470	â¤	133
138	MU	Mauritius	MUR	Mauritius Rupee	480	â¨	137
132	MV	Maldives	MVR	Rufiyaa	462	\N	131
130	MW	Malawi	MWK	Malawi Kwacha	454	\N	129
140	MX	Mexico	MXN	Mexican Peso	484	$	139
131	MY	Malaysia	MYR	Malaysian Ringgit	458	\N	130
148	MZ	Mozambique	MZN	Metical	943	\N	146
150	NA	Namibia	NAD	Namibian Dollar	516	$	148
155	NC	New Caledonia	XPF	CFP Franc	953	\N	153
158	NE	Niger	XOF	CFA Franc BCEAO	952	\N	156
161	NF	Norfolk Island	AUD	Australian Dollar	36 	$	159
159	NG	Nigeria	NGN	Naira	566	â¦	157
157	NI	Nicaragua	NIO	Cordoba Oro	558	\N	155
153	NL	Netherlands	EUR	Euro	978	â¬	151
163	NO	Norway	NOK	Norwegian Krone	578	\N	161
152	NP	Nepal	NPR	Nepalese Rupee	524	â¨	150
151	NR	Nauru	AUD	Australian Dollar	36 	$	149
160	NU	Niue	NZD	New Zealand Dollar	554	$	158
156	NZ	New Zealand	NZD	New Zealand Dollar	554	$	154
164	OM	Oman	OMR	Rial Omani	512	ï·¼	162
168	PA	Panama	PAB	Balboa	590	\N	166
171	PE	Peru	PEN	Nuevo Sol	604	S/.	169
76	PF	French Polynesia	XPF	CFP Franc	953	\N	77
169	PG	Papua New Guinea	PGK	Kina	598	\N	167
172	PH	Philippines	PHP	Philippine Peso	608	â±	170
165	PK	Pakistan	PKR	Pakistan Rupee	586	â¨	163
174	PL	Poland	PLN	Zloty	985	\N	172
185	PM	Saint Pierre And Miquelon	EUR	Euro	978	â¬	200
173	PN	Pitcairn	NZD	New Zealand Dollar	554	$	171
176	PR	Puerto Rico	USD	US Dollar	840	$	174
167	PS	Palestinian Territories	\N	\N	\N	\N	165
175	PT	Portugal	EUR	Euro	978	â¬	173
166	PW	Palau	USD	US Dollar	840	$	164
170	PY	Paraguay	PYG	Guarani	600	\N	168
177	QA	Qatar	QAR	Qatari Rial	634	\N	175
178	RE	Reunion	EUR	Euro	978	â¬	176
179	RO	Romania	RON	New Leu	946	\N	177
192	RS	Serbia	RSD	Serbian Dinar	941	\N	241
180	RU	Russian Federation	RUB	Russian Ruble	643	\N	178
181	RW	Rwanda	RWF	Rwanda Franc	646	\N	179
190	SA	Saudi Arabia	SAR	Saudi Riyal	682	ï·¼	186
198	SB	Solomon Islands	SBD	Solomon Islands Dollar	90 	$	193
193	SC	Seychelles	SCR	Seychelles Rupee	690	â¨	188
204	SD	Sudan	SDD	Sudanese Dinar	736	\N	201
208	SE	Sweden	SEK	Swedish Krona	752	kr	205
195	SG	Singapore	SGD	Singapore Dollar	702	$	190
182	SH	Saint Helena	SHP	Saint Helena Pound	654	Â£	199
197	SI	Slovenia	SIT	Tolar	705	\N	192
206	SJ	Svalbard And Jan Mayen	NOK	Norwegian Krone	578	\N	203
196	SK	Slovakia	SKK	Slovak Koruna	703	\N	191
194	SL	Sierra Leone	SLL	Leone	694	\N	189
188	SM	San Marino	EUR	Euro	978	â¬	184
191	SN	Senegal	XOF	CFA Franc BCEAO	952	\N	187
199	SO	Somalia	SOS	Somali Shilling	706	\N	194
205	SR	Suriname	SRD	Surinam Dollar	968	$	202
189	ST	Sao Tome And Principe	STD	Dobra	678	\N	185
65	SV	El Salvador	SVC	El Salvador Colon	222	â¡	65
210	SY	Syria	SYP	Syrian Pound	760	Â£	207
207	SZ	Swaziland	SZL	Lilangeni	748	\N	204
224	TC	Turks And Caicos Islands	USD	US Dollar	840	$	219
43	TD	Chad	XAF	CFA Franc BEAC	950	\N	42
77	TF	French Southern Territories	EUR	Euro	978	â¬	78
217	TG	Togo	XOF	CFA Franc BCEAO	952	\N	212
215	TH	Thailand	THB	Baht	764	à¸¿	211
212	TJ	Tajikistan	TJS	Somoni	972	\N	209
218	TK	Tokelau	NZD	New Zealand Dollar	554	$	213
216	TL	Timor-Leste	USD	US Dollar	840	$	62
223	TM	Turkmenistan	TMM	Turkmenistan Manat	795	\N	218
221	TN	Tunisia	TND	Tunisian Dinar	788	\N	216
219	TO	Tonga	TOP	Paanga	776	\N	214
62	TP	East Timor	IDR	Indonesia Rupiah	360	\N	62
222	TR	Turkey	TRY	New Turkish Lira	949	â¤	217
220	TT	Trinidad And Tobago	TTD	Trinidad and Tobago Dollar	780	$	215
225	TV	Tuvalu	AUD	Australian Dollar	36 	$	220
211	TW	Taiwan	TWD	New Taiwan Dollar	901	$	208
213	TZ	Tanzania	TZS	Tanzanian Shilling	834	\N	210
227	UA	Ukraine	UAH	Hryvnia	980	\N	222
226	UG	Uganda	UGX	Uganda Shilling	800	\N	221
229	UK	United Kingdom	GBP	Pound Sterling	826	Â£	224
232	UM	U.S. Minor Outlying Islands	USD	US Dollar	840	$	226
230	US	United States	USD	US Dollar	840	$	225
231	UY	Uruguay	UYU	Peso Uruguayo	858	â±	227
234	UZ	Uzbekistan	UZS	Uzbekistan Sum	860	\N	228
95	VA	Holy See (Vatican City State)	EUR	Euro	978	â¬	230
186	VC	Saint Vincent And The Grenadines	XCD	East Caribbean Dollar	951	$	182
236	VE	Venezuela	VEB	Bolivar	862	\N	231
32	VG	British Virgin Islands	USD	US Dollar	840	$	233
233	VI	U.S. Virgin Islands	USD	US Dollar	840	$	234
237	VN	Viet Nam	VND	Dong	704	â«	232
235	VU	Vanuatu	VUV	Vatu	548	\N	229
238	WF	Wallis And Futuna	XPF	CFP Franc	953	\N	235
187	WS	Samoa	WST	Tala	882	\N	183
240	YE	Yemen	YER	Yemeni Rial	886	ï·¼	237
139	YT	Mayotte	EUR	Euro	978	â¬	138
200	ZA	South Africa	ZAR	Rand	710	R	195
241	ZM	Zambia	ZMK	Zambian Kwacha	894	\N	239
242	ZW	Zimbabwe	ZWD	Zimbabwe Dollar	716	$	240
\.


--
-- Name: country_country_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('country_country_id_seq', 242, true);


--
-- Data for Name: crmacct; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY crmacct (crmacct_id, crmacct_number, crmacct_name, crmacct_active, crmacct_type, crmacct_cust_id, crmacct_competitor_id, crmacct_partner_id, crmacct_prospect_id, crmacct_vend_id, crmacct_cntct_id_1, crmacct_cntct_id_2, crmacct_parent_id, crmacct_notes, crmacct_taxauth_id, crmacct_owner_username, crmacct_emp_id, crmacct_salesrep_id, crmacct_usr_username) FROM stdin;
1	ADMIN	Administrator	t	I	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	2	\N	admin
2	MFGADMIN	OpenMFG Administrator	t	I	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	\N	1	\N	mfgadmin
\.


--
-- Name: crmacct_crmacct_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('crmacct_crmacct_id_seq', 24, true);


--
-- Data for Name: crmacctsel; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY crmacctsel (crmacctsel_src_crmacct_id, crmacctsel_dest_crmacct_id, crmacctsel_mrg_crmacct_active, crmacctsel_mrg_crmacct_cntct_id_1, crmacctsel_mrg_crmacct_cntct_id_2, crmacctsel_mrg_crmacct_competitor_id, crmacctsel_mrg_crmacct_cust_id, crmacctsel_mrg_crmacct_emp_id, crmacctsel_mrg_crmacct_name, crmacctsel_mrg_crmacct_notes, crmacctsel_mrg_crmacct_owner_username, crmacctsel_mrg_crmacct_parent_id, crmacctsel_mrg_crmacct_partner_id, crmacctsel_mrg_crmacct_prospect_id, crmacctsel_mrg_crmacct_salesrep_id, crmacctsel_mrg_crmacct_taxauth_id, crmacctsel_mrg_crmacct_type, crmacctsel_mrg_crmacct_usr_username, crmacctsel_mrg_crmacct_vend_id, crmacctsel_mrg_crmacct_number) FROM stdin;
\.


--
-- Data for Name: curr_rate; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY curr_rate (curr_rate_id, curr_id, curr_rate, curr_effective, curr_expires) FROM stdin;
2	2	1.00000000	1970-01-01	2100-01-01
\.


--
-- Name: curr_rate_curr_rate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('curr_rate_curr_rate_id_seq', 2, true);


--
-- Data for Name: curr_symbol; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY curr_symbol (curr_id, curr_base, curr_name, curr_symbol, curr_abbr) FROM stdin;
2	f	US Dollars	$	USD
\.


--
-- Name: curr_symbol_curr_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('curr_symbol_curr_id_seq', 2, true);


--
-- Name: cust_cust_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cust_cust_id_seq', 94, true);


--
-- Name: cust_serial_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('cust_serial_seq', 1, false);


--
-- Data for Name: custform; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY custform (custform_id, custform_custtype_id, custform_custtype, custform_invoice_report_id, custform_creditmemo_report_id, custform_quote_report_id, custform_packinglist_report_id, custform_statement_report_id, custform_sopicklist_report_id, custform_invoice_report_name, custform_creditmemo_report_name, custform_quote_report_name, custform_packinglist_report_name, custform_statement_report_name, custform_sopicklist_report_name) FROM stdin;
\.


--
-- Name: custform_custform_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('custform_custform_id_seq', 7, true);


--
-- Data for Name: custgrp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY custgrp (custgrp_id, custgrp_name, custgrp_descrip) FROM stdin;
\.


--
-- Name: custgrp_custgrp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('custgrp_custgrp_id_seq', 24, true);


--
-- Data for Name: custgrpitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY custgrpitem (custgrpitem_id, custgrpitem_custgrp_id, custgrpitem_cust_id) FROM stdin;
\.


--
-- Name: custgrpitem_custgrpitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('custgrpitem_custgrpitem_id_seq', 47, true);


--
-- Data for Name: custinfo; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY custinfo (cust_id, cust_active, cust_custtype_id, cust_salesrep_id, cust_commprcnt, cust_name, cust_creditlmt, cust_creditrating, cust_financecharge, cust_backorder, cust_partialship, cust_terms_id, cust_discntprcnt, cust_balmethod, cust_ffshipto, cust_shipform_id, cust_shipvia, cust_blanketpos, cust_shipchrg_id, cust_creditstatus, cust_comments, cust_ffbillto, cust_usespos, cust_number, cust_dateadded, cust_exported, cust_emaildelivery, cust_ediemail, cust_edisubject, cust_edifilename, cust_ediemailbody, cust_autoupdatestatus, cust_autoholdorders, cust_edicc, cust_ediprofile_id, cust_preferred_warehous_id, cust_curr_id, cust_creditlmt_curr_id, cust_cntct_id, cust_corrcntct_id, cust_soemaildelivery, cust_soediemail, cust_soedisubject, cust_soedifilename, cust_soediemailbody, cust_soedicc, cust_soediprofile_id, cust_gracedays, cust_ediemailhtml, cust_soediemailhtml, cust_taxzone_id, cust_statementcycle) FROM stdin;
\.


--
-- Data for Name: custtype; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY custtype (custtype_id, custtype_code, custtype_descrip, custtype_char) FROM stdin;
\.


--
-- Name: custtype_custtype_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('custtype_custtype_id_seq', 17, true);


--
-- Data for Name: dept; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY dept (dept_id, dept_number, dept_name) FROM stdin;
\.


--
-- Name: dept_dept_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('dept_dept_id_seq', 1, false);


--
-- Data for Name: destination; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY destination (destination_id, destination_name, destination_city, destination_state, destination_comments) FROM stdin;
\.


--
-- Name: destination_destination_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('destination_destination_id_seq', 12, true);


--
-- Data for Name: docass; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY docass (docass_id, docass_source_id, docass_source_type, docass_target_id, docass_target_type, docass_purpose) FROM stdin;
\.


--
-- Name: docass_docass_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('docass_docass_id_seq', 1, true);


--
-- Data for Name: emp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY emp (emp_id, emp_code, emp_number, emp_active, emp_cntct_id, emp_warehous_id, emp_mgr_emp_id, emp_wage_type, emp_wage, emp_wage_curr_id, emp_wage_period, emp_dept_id, emp_shift_id, emp_notes, emp_image_id, emp_username, emp_extrate, emp_extrate_period, emp_startdate, emp_name) FROM stdin;
2	ADMIN	admin	t	\N	\N	\N	H	\N	\N	H	\N	\N	\N	\N	admin	\N	H	\N	Administrator
1	MFGADMIN	mfgadmin	t	\N	\N	\N	H	\N	\N	H	\N	\N	\N	\N	mfgadmin	\N	H	\N	OpenMFG Administrator
\.


--
-- Name: emp_emp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('emp_emp_id_seq', 2, true);


--
-- Data for Name: empgrp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY empgrp (empgrp_id, empgrp_name, empgrp_descrip) FROM stdin;
\.


--
-- Name: empgrp_empgrp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('empgrp_empgrp_id_seq', 1, false);


--
-- Data for Name: empgrpitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY empgrpitem (empgrpitem_id, empgrpitem_empgrp_id, empgrpitem_emp_id) FROM stdin;
\.


--
-- Name: empgrpitem_empgrpitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('empgrpitem_empgrpitem_id_seq', 1, false);


--
-- Data for Name: evntlog; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY evntlog (evntlog_id, evntlog_evnttime, evntlog_evnttype_id, evntlog_ord_id, evntlog_dispatched, evntlog_action, evntlog_warehous_id, evntlog_number, evntlog_newvalue, evntlog_oldvalue, evntlog_newdate, evntlog_olddate, evntlog_ordtype, evntlog_username) FROM stdin;
\.


--
-- Name: evntlog_evntlog_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('evntlog_evntlog_id_seq', 262, true);


--
-- Data for Name: evntnot; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY evntnot (evntnot_id, evntnot_evnttype_id, evntnot_warehous_id, evntnot_username) FROM stdin;
\.


--
-- Name: evntnot_evntnot_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('evntnot_evntnot_id_seq', 781, true);


--
-- Data for Name: evnttype; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY evnttype (evnttype_id, evnttype_name, evnttype_descrip, evnttype_module) FROM stdin;
1	WoDueDateChanged	Work Order Due Date Changed	W/O
2	WoQtyChanged	Work Order Qty. Changed	W/O
3	WoCreated	Work Order Created	W/O
4	QOHBelowZero	QOH Dropped to a Negative Value	I/M
5	RWoDueDateRequestChange	Request to Change Released Due Date	W/O
6	RWoQtyRequestChange	Request to Change Released W/O Qty.	W/O
7	RWoRequestCancel	Request to Cancel Released W/O	W/O
8	WoCancelled	Work Order Canceled	W/O
9	CannotDistributeTransToGL	Cannot Distribute an Inventory Transaction to the G/L	G/L
10	SoitemQtyChanged	Sales Order Qty. Changed	S/O
11	SoitemCreated	Sales Order Item Added	S/O
12	SoitemSchedDateChanged	Sales Order Item Ship Date Changed	S/O
13	SoitemCancelled	Sales Order Item Cancelled	S/O
14	SoReleased	Sales Order Released	S/O
33	POitemCreate	Purchase Order Purchased Item Line Added	P/O
16	CannotConvertQuote	Cannot Convert a Quote to a Sales Order	S/O
17	DetachCCPayFromSO	Detached Credit Card payment from S/O	S/O
18	WODoubleClockIn	User clocked in to a Work Order without having previously clocked out	W/O
19	WODoubleClockOut	User clocked out of a Work Order without having previously clocked in	W/O
20	WOClockInOnClosedJob	User clocked in to a closed Work Order	W/O
21	WOClockOutWNoClockIn	User clocked out of a Work Order on which s/he was not clocked in	W/O
22	NewIncident	New Incident Created	CRM
23	UpdatedIncident	Incident Modified	CRM
24	ClosedIncident	Incident Closed	CRM
25	ReopenedIncident	Incident Which had been closed previously is being reopened	CRM
27	ToitemCreated	Transfer Order Item Created	I/M
29	ToitemQtyChanged	Transfer Order Item Qty. Changed	I/M
30	ToitemSchedDateChanged	Transfer Order Item Ship Date Changed	I/M
31	ToitemNoDestItemSite	Transfer Order Item created without an Item Site at the Destination Warehouse.	I/M
32	ToitemNoTransitItemSite	Transfer Order Item created without an Item Site at the Transit Warehouse.	I/M
28	ToitemCancelled	Transfer Order Item Cancelled	I/M
15	SoNotesChanged	Sales Order Order Comments Changed	S/O
34	TodoAlarm	To-Do Item Alarm	CRM
35	IncidentAlarm	Incident Alarm	CRM
36	TaskAlarm	Project Task Alarm	CRM
37	CostExceedsMaxDesired	Cost Exceeds Max Desired	P/D
38	PoItemCreatedBySo	Purchase Order Item Created by a Sales Order	P/O
39	PoItemUpdatedBySo	Purchase Order Item Updated by a Sales Order	P/O
40	PoItemSoCancelled	The Sales Order item has been cancelled for a linked Purchase Item	P/O
41	PoItemDropShipped	A Purchase Order Item has been Drop Shipped	P/O
42	CashReceiptPosted	A Cash Receipt has been posted	G/L
45	NewCustomer	A new Customer has been created	S/O
\.


--
-- Name: evnttype_evnttype_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('evnttype_evnttype_id_seq', 45, true);


--
-- Data for Name: expcat; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY expcat (expcat_id, expcat_code, expcat_descrip, expcat_exp_accnt_id, expcat_liability_accnt_id, expcat_active, expcat_purchprice_accnt_id, expcat_freight_accnt_id) FROM stdin;
\.


--
-- Name: expcat_expcat_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('expcat_expcat_id_seq', 14, true);


--
-- Data for Name: file; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY file (file_id, file_title, file_stream, file_descrip) FROM stdin;
\.


--
-- Name: file_file_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('file_file_id_seq', 1, false);


--
-- Data for Name: filter; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY filter (filter_id, filter_screen, filter_value, filter_username, filter_name, filter_selected) FROM stdin;
\.


--
-- Name: filter_filter_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('filter_filter_id_seq', 1, false);


--
-- Data for Name: fincharg; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY fincharg (fincharg_id, fincharg_mincharg, fincharg_graceperiod, fincharg_assessoverdue, fincharg_calcfrom, fincharg_markoninvoice, fincharg_air, fincharg_accnt_id, fincharg_salescat_id, fincharg_lastfc_statementcyclefrom, fincharg_lastfc_custidfrom, fincharg_lastfc_custidto, fincharg_lastfc_statementcycleto) FROM stdin;
\.


--
-- Name: fincharg_fincharg_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('fincharg_fincharg_id_seq', 1, false);


--
-- Data for Name: flcol; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flcol (flcol_id, flcol_flhead_id, flcol_name, flcol_descrip, flcol_report_id, flcol_month, flcol_quarter, flcol_year, flcol_showdb, flcol_prcnt, flcol_priortype, flcol_priormonth, flcol_priorquarter, flcol_prioryear, flcol_priorprcnt, flcol_priordiff, flcol_priordiffprcnt, flcol_budget, flcol_budgetprcnt, flcol_budgetdiff, flcol_budgetdiffprcnt) FROM stdin;
1	6	Current	Current Month	335	t	f	f	f	t	P	f	f	N	f	f	f	f	f	f	f
2	6	Current, Budget	Current to Budget	336	t	f	f	f	f	P	f	f	N	f	f	f	t	f	t	t
3	6	Current, Prior Month	Current to Prior Month End	337	t	f	f	f	f	P	t	f	N	f	t	t	f	f	f	f
4	6	Current, Prior Quarter	Current to Prior Quarter End	346	t	f	f	f	f	P	f	t	N	f	t	t	f	f	f	f
5	6	Current, Prior Year	Current to Prior Year End	338	t	f	f	f	f	P	f	f	F	f	t	t	f	f	f	f
6	6	Current, Year Ago	Current to Month Prior Year	337	t	f	f	f	f	Y	t	f	N	f	t	t	f	f	f	f
7	7	Month	Current Month	335	t	f	f	f	t	P	f	f	N	f	f	f	f	f	f	f
8	7	Month, Budget	Current Month to Budget	336	t	f	f	f	f	P	f	f	N	f	f	f	t	f	t	t
9	7	Month, Prior Month	Current Month to Prior Month	337	t	f	f	f	f	P	t	f	N	f	t	t	f	f	f	f
10	7	Month, YTD	Month and Year to Date	334	t	f	t	f	t	P	f	f	N	f	f	f	f	f	f	f
11	7	Month, QTD	Month and Quarter to Date	339	t	t	f	f	t	P	f	f	N	f	f	f	f	f	f	f
12	7	QTD, Budget	Quarter to Date to Budget	341	f	t	f	f	f	P	f	f	N	f	f	f	t	f	t	t
13	7	QTD, Prior Quarter	Quarter to Date to Prior Quarter	342	f	t	f	f	f	P	f	t	N	f	t	t	f	f	f	f
14	7	YTD	Year To Date	343	f	f	t	f	t	P	f	f	N	f	f	f	f	f	f	f
15	7	YTD, Budget	Year to Date to Budget	344	f	f	t	f	f	P	f	f	N	f	f	f	t	f	t	t
16	7	YTD, Prior Full Year	Year to Date to Prior Full Year	345	f	f	t	f	f	P	f	f	F	f	t	t	f	f	f	f
17	7	Month, Prior Year Month	Current Month to Same Month Prior Year	337	t	f	f	f	f	Y	t	f	N	f	t	t	f	f	f	f
19	7	YTD, Prior Year YTD	Year to Date to Year to Date Prior Year	345	f	f	t	f	f	P	f	f	D	f	t	t	f	f	f	f
20	7	QTD	Quarter to Date	340	f	t	f	f	t	P	f	f	N	f	f	f	f	f	f	f
18	7	QTD, Prior Year Quarter	Quarter to Date to Same Quarter Prior Year	342	f	t	f	f	f	Y	f	t	N	f	t	t	f	f	f	f
\.


--
-- Name: flcol_flcol_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flcol_flcol_id_seq', 20, true);


--
-- Data for Name: flgrp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flgrp (flgrp_id, flgrp_flhead_id, flgrp_flgrp_id, flgrp_order, flgrp_name, flgrp_descrip, flgrp_subtotal, flgrp_summarize, flgrp_subtract, flgrp_showstart, flgrp_showend, flgrp_showdelta, flgrp_showbudget, flgrp_showstartprcnt, flgrp_showendprcnt, flgrp_showdeltaprcnt, flgrp_showbudgetprcnt, flgrp_prcnt_flgrp_id, flgrp_showdiff, flgrp_showdiffprcnt, flgrp_showcustom, flgrp_showcustomprcnt, flgrp_usealtsubtotal, flgrp_altsubtotal) FROM stdin;
2	3	-1	1	Revenue	Revenue	t	f	f	f	t	f	t	f	t	f	t	3	t	t	t	t	f	\N
3	3	2	1	Sales	Sales	t	f	f	f	t	f	f	f	f	f	f	3	t	t	t	t	f	\N
4	3	2	2	Cost of Goods Sold	Cost of Goods Sold	f	f	f	f	f	f	f	f	f	f	f	3	f	f	f	f	f	\N
5	3	2	3	Gross Margin on Sales....................	Gross Margin on Sales....................	f	f	f	f	f	f	f	f	f	f	f	3	f	f	f	f	f	\N
6	3	-1	2	Expenses	Expenses	f	f	t	f	f	f	f	f	f	f	f	3	f	f	f	f	f	\N
7	3	6	1	Expenses	Expenses	t	f	f	f	t	f	t	f	t	f	t	3	t	t	t	t	f	\N
8	3	-1	3	Net Income..............................	Net Income..............................	f	f	f	f	f	f	f	f	f	f	f	3	f	f	f	f	f	\N
9	4	-1	2	Liabilities and Owner's Equity	Liabilities and Owner's Equity	t	f	t	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
10	4	9	1	Liabilities	Liabilities	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
11	4	10	1	Current Liabilities	Current Liabilities	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
12	4	10	2	Long-Term Liabilities	Long-Term Liabilites	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
13	4	9	2	Owner's Equity	Owner's Equity	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
14	4	13	1	Shareholders' Equity	Shareholders' Equity	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
15	4	13	2	Profit / Loss	Profit / Loss	t	t	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
16	4	13	3	Retained Earnings	Retained Earnings	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
17	4	-1	1	Assets	Assets	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
18	4	17	1	Current Assets	Current Assets	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
19	4	17	2	Fixed Assets	Fixed Assets	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
20	4	17	3	Other Assets	Other Assets	t	f	f	f	t	f	f	f	f	f	f	-1	f	f	t	f	f	\N
21	5	-1	1	Cash Flows	Cash Flows	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
22	5	21	1	Cash Flows from Operating Activities	Cash Flows from Operating Activities	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
23	5	22	1	Cash Flows From Operating Activities	Cash Flows From Operating Activities	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
24	5	23	1	Net Income	Net Income	f	t	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
25	5	22	2	Charges Not Using Cash	Charges Not Using Cash	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
26	5	22	3	Change in Current Assets	Change in Current Assets	f	f	t	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
27	5	22	4	Short-Term Investments	Short-Term Investments	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
28	5	22	5	Net Receivables	Net Receivables	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
29	5	22	6	Inventory	Inventory	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
30	5	22	8	Change in Current Liabilities	Change in Current Liabilities	f	f	f	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
31	5	22	9	Accounts Payable	Accounts Payable	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
32	5	22	7	Prepaid Expenses	Prepaid Expenses	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
33	5	22	10	Notes Payable Current	Notes Payable Current	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
34	5	22	11	Current Maturities on Long-Term Debt	Current Maturities on Long-Term Debt	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
35	5	22	12	Taxes Payable	Tases Payable	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
36	5	22	13	Other Current Liabilities	Other Current Liabilities	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
37	5	22	14	Total Cash Flows from Operating Activities..........	Total Cash Flows from Operating Activities..........	f	f	f	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
38	5	21	2	Cash Flows from Investing Activities	Cash Flows from Investing Activities	t	f	t	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
39	5	38	1	Property, Plant, and Equipment	Property, Plant, and Equipment	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
40	5	38	2	Other Assets	Other Assets	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
41	5	38	3	Total Cash Flows from Investing Activities..........	Total Cash Flows from Investing Activities..........	f	f	f	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
42	5	21	3	Cash Flows from Financing Activities	Cash Flows from Financing Activities	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
43	5	42	1	Long-Term Debt	Long-Term Debt	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
44	5	42	2	Common Stock and Equity	Common Stock and Equity	t	f	f	f	f	f	f	f	f	f	f	-1	t	f	t	f	f	\N
45	5	42	3	Total Cash Flows from Financing Activities..........	Total Cash Flows from Financing Activities..........	f	f	f	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
46	5	-1	2	Cash Position	Cash Position	f	f	f	f	f	f	f	f	f	f	f	-1	f	f	f	f	f	\N
47	6	-1	1	ASSETS	ASSETS	t	f	f	f	t	f	t	f	f	f	f	-1	f	f	f	f	t	Total Assets
48	6	-1	2	LIABILITIES AND OWNERS EQUITY	LIABILITIES AND OWNERS EQUITY	t	f	t	f	t	f	t	f	f	f	f	-1	f	f	f	f	t	Total Liabilities and Owners Equity
49	6	48	1	LIABILITIES	LIABILITIES	t	f	f	f	t	f	t	f	t	f	t	-1	f	f	f	f	t	Total Liabilities
50	6	48	2	OWNERS EQUITY	OWNERS EQUITY	t	f	f	f	t	f	t	f	t	f	t	-1	f	f	f	f	t	Total Owners Equity
51	6	50	2	Net Income		f	t	f	f	t	f	t	f	t	f	t	-1	f	f	f	f	f	
52	7	-1	1	INCOME	INCOME	t	f	f	f	f	f	t	f	f	f	f	-1	t	f	f	f	t	Net Income
53	7	52	2	REVENUE	REVENUE	t	f	f	f	f	f	t	f	f	f	f	-1	t	f	f	f	t	Total Net Revenue
54	7	52	3	EXPENSES	EXPENSES	t	f	t	f	f	f	t	f	f	f	f	-1	t	f	f	f	t	Total Net Expenses
\.


--
-- Name: flgrp_flgrp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flgrp_flgrp_id_seq', 54, true);


--
-- Data for Name: flhead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flhead (flhead_id, flhead_name, flhead_descrip, flhead_showtotal, flhead_showstart, flhead_showend, flhead_showdelta, flhead_showbudget, flhead_showdiff, flhead_showcustom, flhead_custom_label, flhead_usealttotal, flhead_alttotal, flhead_usealtbegin, flhead_altbegin, flhead_usealtend, flhead_altend, flhead_usealtdebits, flhead_altdebits, flhead_usealtcredits, flhead_altcredits, flhead_usealtbudget, flhead_altbudget, flhead_usealtdiff, flhead_altdiff, flhead_type, flhead_active, flhead_sys, flhead_notes) FROM stdin;
3	Income Statement (OpenMFG)	Income Statement Template	t	t	t	f	t	t	t	Statement	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	A	t	f	
4	Balance Sheet (OpenMFG)	Balance Sheet Template	t	f	t	f	f	f	t	Statement	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	A	t	f	
5	Statement of Cash Flows (OpenMFG)	Statement of Cash Flows Template	t	f	f	f	f	t	t	Statement	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	A	t	f	
6	Basic Balance Sheet	Balance Sheet Template	f	f	f	f	f	f	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	f	\N	B	t	t	
7	Basic Income Statement	Income Statement Template	f	f	f	f	f	f	f		f		f		f		f		f		f		f		I	t	t	
\.


--
-- Name: flhead_flhead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flhead_flhead_id_seq', 7, true);


--
-- Data for Name: flitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flitem (flitem_id, flitem_flhead_id, flitem_flgrp_id, flitem_order, flitem_accnt_id, flitem_showstart, flitem_showend, flitem_showdelta, flitem_showbudget, flitem_subtract, flitem_showstartprcnt, flitem_showendprcnt, flitem_showdeltaprcnt, flitem_showbudgetprcnt, flitem_prcnt_flgrp_id, flitem_showdiff, flitem_showdiffprcnt, flitem_showcustom, flitem_showcustomprcnt, flitem_custom_source, flitem_company, flitem_profit, flitem_number, flitem_sub, flitem_type, flitem_subaccnttype_code) FROM stdin;
2	6	47	1	-1	f	t	f	t	f	f	t	f	t	-1	t	f	f	f	S	All	All	All	All	A	All
3	6	49	1	-1	f	t	f	t	f	f	t	f	t	-1	t	f	f	f	S	All	All	All	All	L	All
4	6	50	1	-1	f	t	f	t	f	f	t	f	t	-1	t	f	f	f	S	All	All	All	All	Q	All
5	6	51	1	-1	f	t	f	t	f	f	f	f	f	-1	t	f	f	f	S	All	All	All	All	R	All
6	6	51	2	-1	f	t	f	t	t	f	f	f	f	-1	t	f	f	f	S	All	All	All	All	E	All
7	7	53	1	-1	f	f	f	t	f	f	f	f	t	-1	t	t	f	f	S	All	All	All	All	R	All
8	7	54	1	-1	f	f	f	t	f	f	f	f	t	-1	t	t	f	f	S	All	All	All	All	E	All
\.


--
-- Name: flitem_flitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flitem_flitem_id_seq', 8, true);


--
-- Data for Name: flnotes; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flnotes (flnotes_id, flnotes_flhead_id, flnotes_period_id, flnotes_notes) FROM stdin;
\.


--
-- Name: flnotes_flnotes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flnotes_flnotes_id_seq', 1, false);


--
-- Data for Name: flrpt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flrpt (flrpt_flhead_id, flrpt_period_id, flrpt_username, flrpt_order, flrpt_level, flrpt_type, flrpt_type_id, flrpt_beginning, flrpt_ending, flrpt_debits, flrpt_credits, flrpt_budget, flrpt_beginningprcnt, flrpt_endingprcnt, flrpt_debitsprcnt, flrpt_creditsprcnt, flrpt_budgetprcnt, flrpt_parent_id, flrpt_diff, flrpt_diffprcnt, flrpt_custom, flrpt_customprcnt, flrpt_altname, flrpt_accnt_id, flrpt_interval, flrpt_id) FROM stdin;
\.


--
-- Name: flrpt_flrpt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flrpt_flrpt_id_seq', 1, false);


--
-- Data for Name: flspec; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY flspec (flspec_id, flspec_flhead_id, flspec_flgrp_id, flspec_order, flspec_name, flspec_type, flspec_showstart, flspec_showend, flspec_showdelta, flspec_showbudget, flspec_subtract, flspec_showstartprcnt, flspec_showendprcnt, flspec_showdeltaprcnt, flspec_showbudgetprcnt, flspec_showdiff, flspec_showdiffprcnt, flspec_prcnt_flgrp_id, flspec_showcustom, flspec_showcustomprcnt, flspec_custom_source) FROM stdin;
\.


--
-- Name: flspec_flspec_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('flspec_flspec_id_seq', 1, false);


--
-- Data for Name: form; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY form (form_id, form_name, form_descrip, form_report_id, form_key, form_report_name) FROM stdin;
\.


--
-- Name: form_form_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('form_form_id_seq', 18, true);


--
-- Data for Name: freightclass; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY freightclass (freightclass_id, freightclass_code, freightclass_descrip) FROM stdin;
\.


--
-- Name: freightclass_freightclass_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('freightclass_freightclass_id_seq', 1, false);


--
-- Data for Name: glseries; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY glseries (glseries_id, glseries_sequence, glseries_doctype, glseries_docnumber, glseries_accnt_id, glseries_amount, glseries_source, glseries_distdate, glseries_notes, glseries_misc_id) FROM stdin;
\.


--
-- Name: glseries_glseries_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('glseries_glseries_id_seq', 1563, true);


--
-- Data for Name: gltrans; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY gltrans (gltrans_id, gltrans_exported, gltrans_created, gltrans_date, gltrans_sequence, gltrans_accnt_id, gltrans_source, gltrans_docnumber, gltrans_misc_id, gltrans_amount, gltrans_notes, gltrans_journalnumber, gltrans_posted, gltrans_doctype, gltrans_rec, gltrans_username, gltrans_deleted) FROM stdin;
\.


--
-- Name: gltrans_gltrans_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('gltrans_gltrans_id_seq', 7008, true);


--
-- Name: gltrans_sequence_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('gltrans_sequence_seq', 3583, true);


--
-- Data for Name: grp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY grp (grp_id, grp_name, grp_descrip) FROM stdin;
\.


--
-- Name: grp_grp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('grp_grp_id_seq', 1, false);


--
-- Data for Name: grppriv; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY grppriv (grppriv_id, grppriv_grp_id, grppriv_priv_id) FROM stdin;
\.


--
-- Name: grppriv_grppriv_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('grppriv_grppriv_id_seq', 1, false);


--
-- Data for Name: hnfc; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY hnfc (hnfc_id, hnfc_code) FROM stdin;
1	Dr
2	Miss
3	Mr
4	Mrs
5	Ms
\.


--
-- Name: hnfc_hnfc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('hnfc_hnfc_id_seq', 5, true);


--
-- Data for Name: image; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY image (image_id, image_name, image_descrip, image_data) FROM stdin;
14	Blue Pinstripe Background	Blue Pinstripe Background	begin 644 internal\nMB5!.1PT*&@H````-24A$4@````(````""`(```#]U)IS````"7!(67,```L2\nM```+$@'2W7[\\````%DE$050(F6-DLNUD8&!@\\?+R8F!@```-9P&L)F@250``\n*``!)14Y$KD)@@@``\n`\nend\n
\.


--
-- Name: image_image_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('image_image_id_seq', 6630, true);


--
-- Data for Name: imageass; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY imageass (imageass_id, imageass_source_id, imageass_source, imageass_image_id, imageass_purpose) FROM stdin;
\.


--
-- Data for Name: incdt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdt (incdt_id, incdt_number, incdt_crmacct_id, incdt_cntct_id, incdt_summary, incdt_descrip, incdt_item_id, incdt_timestamp, incdt_status, incdt_assigned_username, incdt_incdtcat_id, incdt_incdtseverity_id, incdt_incdtpriority_id, incdt_incdtresolution_id, incdt_lotserial, incdt_ls_id, incdt_aropen_id, incdt_owner_username, incdt_recurring_incdt_id, incdt_updated, incdt_prj_id, incdt_public) FROM stdin;
\.


--
-- Name: incdt_incdt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdt_incdt_id_seq', 1, false);


--
-- Data for Name: incdtcat; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdtcat (incdtcat_id, incdtcat_name, incdtcat_order, incdtcat_descrip, incdtcat_ediprofile_id) FROM stdin;
\.


--
-- Name: incdtcat_incdtcat_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdtcat_incdtcat_id_seq', 1, false);


--
-- Data for Name: incdthist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdthist (incdthist_id, incdthist_incdt_id, incdthist_change, incdthist_target_id, incdthist_timestamp, incdthist_username, incdthist_descrip) FROM stdin;
\.


--
-- Name: incdthist_incdthist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdthist_incdthist_id_seq', 1, false);


--
-- Data for Name: incdtpriority; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdtpriority (incdtpriority_id, incdtpriority_name, incdtpriority_order, incdtpriority_descrip) FROM stdin;
2	High	1	\N
3	Normal	2	\N
4	Low	3	\N
5	Very Low	4	\N
1	Very High	0	\N
\.


--
-- Name: incdtpriority_incdtpriority_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdtpriority_incdtpriority_id_seq', 5, true);


--
-- Data for Name: incdtresolution; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdtresolution (incdtresolution_id, incdtresolution_name, incdtresolution_order, incdtresolution_descrip) FROM stdin;
1	Fixed	0	\N
2	Duplicate	1	\N
3	Not Fixable	2	\N
4	Won't Fix	3	\N
\.


--
-- Name: incdtresolution_incdtresolution_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdtresolution_incdtresolution_id_seq', 4, true);


--
-- Data for Name: incdtseverity; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY incdtseverity (incdtseverity_id, incdtseverity_name, incdtseverity_order, incdtseverity_descrip) FROM stdin;
1	Trivial	0	\N
2	Minor	1	\N
3	Normal	2	\N
4	Severe	3	\N
5	Critical	4	\N
\.


--
-- Name: incdtseverity_incdtseverity_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('incdtseverity_incdtseverity_id_seq', 5, true);


--
-- Data for Name: invbal; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invbal (invbal_id, invbal_period_id, invbal_itemsite_id, invbal_qoh_beginning, invbal_qoh_ending, invbal_qty_in, invbal_qty_out, invbal_value_beginning, invbal_value_ending, invbal_value_in, invbal_value_out, invbal_nn_beginning, invbal_nn_ending, invbal_nn_in, invbal_nn_out, invbal_nnval_beginning, invbal_nnval_ending, invbal_nnval_in, invbal_nnval_out, invbal_dirty) FROM stdin;
\.


--
-- Name: invbal_invbal_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invbal_invbal_id_seq', 1, false);


--
-- Name: invc_invc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invc_invc_id_seq', 1, false);


--
-- Data for Name: invchead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invchead (invchead_id, invchead_cust_id, invchead_shipto_id, invchead_ordernumber, invchead_orderdate, invchead_posted, invchead_printed, invchead_invcnumber, invchead_invcdate, invchead_shipdate, invchead_ponumber, invchead_shipvia, invchead_fob, invchead_billto_name, invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, invchead_billto_city, invchead_billto_state, invchead_billto_zipcode, invchead_billto_phone, invchead_shipto_name, invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, invchead_shipto_city, invchead_shipto_state, invchead_shipto_zipcode, invchead_shipto_phone, invchead_salesrep_id, invchead_commission, invchead_terms_id, invchead_freight, invchead_misc_amount, invchead_misc_descrip, invchead_misc_accnt_id, invchead_payment, invchead_paymentref, invchead_notes, invchead_billto_country, invchead_shipto_country, invchead_prj_id, invchead_curr_id, invchead_gldistdate, invchead_recurring, invchead_recurring_interval, invchead_recurring_type, invchead_recurring_until, invchead_recurring_invchead_id, invchead_shipchrg_id, invchead_taxzone_id, invchead_void, invchead_saletype_id, invchead_shipzone_id) FROM stdin;
\.


--
-- Name: invchead_invchead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invchead_invchead_id_seq', 1, false);


--
-- Data for Name: invcheadtax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invcheadtax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: invcitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invcitem (invcitem_id, invcitem_invchead_id, invcitem_linenumber, invcitem_item_id, invcitem_warehous_id, invcitem_custpn, invcitem_number, invcitem_descrip, invcitem_ordered, invcitem_billed, invcitem_custprice, invcitem_price, invcitem_notes, invcitem_salescat_id, invcitem_taxtype_id, invcitem_qty_uom_id, invcitem_qty_invuomratio, invcitem_price_uom_id, invcitem_price_invuomratio, invcitem_coitem_id, invcitem_updateinv, invcitem_rev_accnt_id) FROM stdin;
\.


--
-- Name: invcitem_invcitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invcitem_invcitem_id_seq', 1, false);


--
-- Data for Name: invcitemtax; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invcitemtax (taxhist_id, taxhist_parent_id, taxhist_taxtype_id, taxhist_tax_id, taxhist_basis, taxhist_basis_tax_id, taxhist_sequence, taxhist_percent, taxhist_amount, taxhist_tax, taxhist_docdate, taxhist_distdate, taxhist_curr_id, taxhist_curr_rate, taxhist_journalnumber) FROM stdin;
\.


--
-- Data for Name: invcnt; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invcnt (invcnt_id, invcnt_itemsite_id, invcnt_tagdate, invcnt_cntdate, invcnt_qoh_before, invcnt_qoh_after, invcnt_matcost, invcnt_posted, invcnt_postdate, invcnt_comments, invcnt_priority, invcnt_tagnumber, invcnt_invhist_id, invcnt_location_id, invcnt_cnt_username, invcnt_post_username, invcnt_tag_username) FROM stdin;
\.


--
-- Name: invcnt_invcnt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invcnt_invcnt_id_seq', 213, true);


--
-- Data for Name: invdetail; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invdetail (invdetail_id, invdetail_transtype, invdetail_invhist_id, invdetail_location_id, invdetail_qty, invdetail_comments, invdetail_qty_before, invdetail_qty_after, invdetail_invcitem_id, invdetail_expiration, invdetail_warrpurc, invdetail_ls_id) FROM stdin;
\.


--
-- Name: invdetail_invdetail_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invdetail_invdetail_id_seq', 1326, true);


--
-- Data for Name: invhist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invhist (invhist_id, invhist_itemsite_id, invhist_transdate, invhist_transtype, invhist_invqty, invhist_invuom, invhist_ordnumber, invhist_docnumber, invhist_qoh_before, invhist_qoh_after, invhist_unitcost, invhist_acct_id, invhist_xfer_warehous_id, invhist_comments, invhist_posted, invhist_imported, invhist_hasdetail, invhist_ordtype, invhist_analyze, invhist_user, invhist_created, invhist_costmethod, invhist_value_before, invhist_value_after, invhist_series) FROM stdin;
\.


--
-- Name: invhist_invhist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invhist_invhist_id_seq', 2859, true);


--
-- Data for Name: invhistexpcat; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY invhistexpcat (invhistexpcat_id, invhistexpcat_invhist_id, invhistexpcat_expcat_id) FROM stdin;
\.


--
-- Name: invhistexpcat_invhistexpcat_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('invhistexpcat_invhistexpcat_id_seq', 1, false);


--
-- Data for Name: ipsass; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipsass (ipsass_id, ipsass_ipshead_id, ipsass_cust_id, ipsass_custtype_id, ipsass_custtype_pattern, ipsass_shipto_id, ipsass_shipto_pattern) FROM stdin;
\.


--
-- Name: ipsass_ipsass_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsass_ipsass_id_seq', 1, false);


--
-- Name: ipsctyp_ipsctyp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsctyp_ipsctyp_id_seq', 16, true);


--
-- Name: ipscust_ipscust_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipscust_ipscust_id_seq', 21, true);


--
-- Data for Name: ipsfreight; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipsfreight (ipsfreight_id, ipsfreight_ipshead_id, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipsfreight_warehous_id, ipsfreight_shipzone_id, ipsfreight_freightclass_id, ipsfreight_shipvia) FROM stdin;
\.


--
-- Name: ipsfreight_ipsfreight_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsfreight_ipsfreight_id_seq', 1, false);


--
-- Data for Name: ipshead; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipshead (ipshead_id, ipshead_name, ipshead_descrip, ipshead_effective, ipshead_expires, ipshead_curr_id, ipshead_updated) FROM stdin;
\.


--
-- Name: ipshead_ipshead_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipshead_ipshead_id_seq', 58, true);


--
-- Name: ipsitem_ipsitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsitem_ipsitem_id_seq', 75, true);


--
-- Data for Name: ipsitemchar; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipsitemchar (ipsitemchar_id, ipsitemchar_ipsitem_id, ipsitemchar_char_id, ipsitemchar_value, ipsitemchar_price) FROM stdin;
\.


--
-- Name: ipsitemchar_ipsitemchar_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsitemchar_ipsitemchar_id_seq', 1, false);


--
-- Data for Name: ipsiteminfo; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipsiteminfo (ipsitem_id, ipsitem_ipshead_id, ipsitem_item_id, ipsitem_qtybreak, ipsitem_price, ipsitem_qty_uom_id, ipsitem_price_uom_id, ipsitem_discntprcnt, ipsitem_fixedamtdiscount, ipsitem_prodcat_id, ipsitem_type, ipsitem_warehous_id) FROM stdin;
\.


--
-- Data for Name: ipsprodcat_bak; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY ipsprodcat_bak (ipsprodcat_id, ipsprodcat_ipshead_id, ipsprodcat_prodcat_id, ipsprodcat_qtybreak, ipsprodcat_discntprcnt, ipsprodcat_fixedamtdiscount) FROM stdin;
\.


--
-- Name: ipsprodcat_ipsprodcat_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('ipsprodcat_ipsprodcat_id_seq', 1, false);


--
-- Data for Name: item; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY item (item_id, item_number, item_descrip1, item_descrip2, item_classcode_id, item_picklist, item_comments, item_sold, item_fractional, item_active, item_type, item_prodweight, item_packweight, item_prodcat_id, item_exclusive, item_listprice, item_config, item_extdescrip, item_upccode, item_maxcost, item_inv_uom_id, item_price_uom_id, item_warrdays, item_freightclass_id, item_tax_recoverable, item_listcost) FROM stdin;
\.


--
-- Name: item_item_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('item_item_id_seq', 299, true);


--
-- Data for Name: itemalias; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemalias (itemalias_id, itemalias_item_id, itemalias_number, itemalias_comments, itemalias_usedescrip, itemalias_descrip1, itemalias_descrip2, itemalias_crmacct_id) FROM stdin;
\.


--
-- Name: itemalias_itemalias_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemalias_itemalias_id_seq', 15, true);


--
-- Name: itematr_itematr_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itematr_itematr_id_seq', 29, true);


--
-- Data for Name: itemcost; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemcost (itemcost_id, itemcost_item_id, itemcost_costelem_id, itemcost_lowlevel, itemcost_stdcost, itemcost_posted, itemcost_actcost, itemcost_updated, itemcost_curr_id) FROM stdin;
\.


--
-- Name: itemcost_itemcost_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemcost_itemcost_id_seq', 299, true);


--
-- Name: itemfrez_itemfrez_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemfrez_itemfrez_seq', 1, false);


--
-- Data for Name: itemgrp; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemgrp (itemgrp_id, itemgrp_name, itemgrp_descrip, itemgrp_catalog) FROM stdin;
\.


--
-- Name: itemgrp_itemgrp_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemgrp_itemgrp_id_seq', 19, true);


--
-- Data for Name: itemgrpitem; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemgrpitem (itemgrpitem_id, itemgrpitem_itemgrp_id, itemgrpitem_item_id, itemgrpitem_item_type) FROM stdin;
\.


--
-- Name: itemgrpitem_itemgrpitem_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemgrpitem_itemgrpitem_id_seq', 112, true);


--
-- Name: itemimage_itemimage_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemimage_itemimage_id_seq', 20, true);


--
-- Data for Name: itemloc; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemloc (itemloc_id, itemloc_itemsite_id, itemloc_location_id, itemloc_qty, itemloc_expiration, itemloc_consolflag, itemloc_ls_id, itemloc_warrpurc) FROM stdin;
\.


--
-- Name: itemloc_itemloc_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemloc_itemloc_id_seq', 511, true);


--
-- Name: itemloc_series_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemloc_series_seq', 1022, true);


--
-- Data for Name: itemlocdist; Type: TABLE DATA; Schema: public; Owner: admin
--

COPY itemlocdist (itemlocdist_id, itemlocdist_itemlocdist_id, itemlocdist_source_type, itemlocdist_source_id, itemlocdist_qty, itemlocdist_series, itemlocdist_invhist_id, itemlocdist_itemsite_id, itemlocdist_reqlotserial, itemlocdist_flush, itemlocdist_expiration, itemlocdist_distlotserial, itemlocdist_warranty, itemlocdist_ls_id, itemlocdist_order_type, itemlocdist_order_id) FROM stdin;
\.


--
-- Name: itemlocdist_itemlocdist_id_seq; Type: SEQUENCE SET; Schema: public; Owner: admin
--

SELECT pg_catalog.setval('itemlocdist_itemlocdist_id_seq', 2133, true);


--
