1-- ===================================================================
2-- Copyright (C) 2003-2010 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3-- Copyright (C) 2008-2010 Regis Houssin        <regis.houssin@inodbox.com>
4-- Copyright (C) 2011-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
5-- Copyright (C) 2012      Juanjo Menent		<jmenent@2byte.es>
6--
7-- This program is free software; you can redistribute it and/or modify
8-- it under the terms of the GNU General Public License as published by
9-- the Free Software Foundation; either version 3 of the License, or
10-- (at your option) any later version.
11--
12-- This program is distributed in the hope that it will be useful,
13-- but WITHOUT ANY WARRANTY; without even the implied warranty of
14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15-- GNU General Public License for more details.
16--
17-- You should have received a copy of the GNU General Public License
18-- along with this program. If not, see <https://www.gnu.org/licenses/>.
19--
20-- ===================================================================
21
22create table llx_expedition
23(
24  rowid                 integer AUTO_INCREMENT PRIMARY KEY,
25  tms                   timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
26  ref                   varchar(30)        NOT NULL,
27  entity                integer  DEFAULT 1 NOT NULL,	-- multi company id
28  fk_soc                integer            NOT NULL,
29  fk_projet  		integer  DEFAULT NULL,
30
31  ref_ext               varchar(255),					-- reference into an external system (not used by dolibarr)
32  ref_int				varchar(255),					-- reference into an internal system (used by dolibarr to store extern id like paypal info)
33  ref_customer          varchar(255),					-- customer number
34
35  date_creation         datetime,						-- date de creation
36  fk_user_author        integer,						-- author of creation
37  fk_user_modif         integer,						-- author of last change
38  date_valid            datetime,						-- date de validation
39  fk_user_valid         integer,						-- valideur
40  date_delivery			datetime	DEFAULT NULL,		-- date planned of delivery
41  date_expedition       datetime,						-- not used (deprecated)
42  fk_address  			integer		DEFAULT NULL, 		-- delivery address (deprecated)
43  fk_shipping_method    integer,
44  tracking_number       varchar(50),
45  fk_statut             smallint	DEFAULT 0,			-- 0 = draft, 1 = validated, 2 = billed or closed depending on WORKFLOW_BILL_ON_SHIPMENT option
46  billed                smallint    DEFAULT 0,
47
48  height                float,							-- height
49  width                 float,							-- with
50  size_units            integer,						-- unit of all sizes (height, width, depth)
51  size                  float,							-- depth
52  weight_units          integer,						-- unit of weight
53  weight                float,							-- weight
54  note_private          text,
55  note_public           text,
56  model_pdf             varchar(255),
57  last_main_doc			varchar(255),					-- relative filepath+filename of last main generated document
58
59  fk_incoterms          integer,						-- for incoterms
60  location_incoterms    varchar(255),					-- for incoterms
61
62  import_key			varchar(14),
63  extraparams			varchar(255)							-- for other parameters with json format
64)ENGINE=innodb;
65