diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a0c31505d5e..e876d5caee2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2639,6 +2639,8 @@ class CommandeFournisseur extends CommonOrder { global $user,$langs,$conf; + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + dol_syslog(get_class($this)."::initAsSpecimen"); $now=dol_now(); diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index e4cdd9351e6..39df4d2f59c 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -302,3 +302,65 @@ ALTER TABLE llx_inventorydet DROP COLUMN new_pmp; UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos-envois?code={TRACKID}' WHERE code IN ('COLSUI'); UPDATE llx_c_shipment_mode SET label = 'https://www.laposte.fr/outils/suivre-vos-envois?code={TRACKID}' WHERE code IN ('LETTREMAX'); + + + +create table llx_reception +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + ref varchar(30) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer NOT NULL, + fk_projet integer DEFAULT NULL, + + ref_ext varchar(30), -- reference into an external system (not used by dolibarr) + ref_int varchar(30), -- reference into an internal system (used by dolibarr to store extern id like paypal info) + ref_supplier varchar(30), -- customer number + + date_creation datetime, -- date de creation + fk_user_author integer, -- author of creation + fk_user_modif integer, -- author of last change + date_valid datetime, -- date de validation + fk_user_valid integer, -- valideur + date_delivery datetime DEFAULT NULL, -- date planned of delivery + date_reception datetime, + fk_shipping_method integer, + tracking_number varchar(50), + fk_statut smallint DEFAULT 0, -- 0 = draft, 1 = validated, 2 = billed or closed depending on WORKFLOW_BILL_ON_SHIPMENT option + billed smallint DEFAULT 0, + + height float, -- height + width float, -- with + size_units integer, -- unit of all sizes (height, width, depth) + size float, -- depth + weight_units integer, -- unit of weight + weight float, -- weight + note_private text, + note_public text, + model_pdf varchar(255), + fk_incoterms integer, -- for incoterms + location_incoterms varchar(255), -- for incoterms + + import_key varchar(14), + extraparams varchar(255) -- for other parameters with json format +)ENGINE=innodb; + +ALTER TABLE llx_reception ADD UNIQUE INDEX idx_reception_uk_ref (ref, entity); + +ALTER TABLE llx_reception ADD INDEX idx_reception_fk_soc (fk_soc); +ALTER TABLE llx_reception ADD INDEX idx_reception_fk_user_author (fk_user_author); +ALTER TABLE llx_reception ADD INDEX idx_reception_fk_user_valid (fk_user_valid); +ALTER TABLE llx_reception ADD INDEX idx_reception_fk_shipping_method (fk_shipping_method); + +create table llx_reception_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) -- import key +) ENGINE=innodb; + +ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_object); + + diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0b416512ffa..15c021f53bc 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1183,7 +1183,9 @@ class Reception extends CommonObject public function initAsSpecimen() { global $langs; - dol_include_once('/fourn/class/fournisseur.commande.dispatch.class.php'); + + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $now=dol_now(); dol_syslog(get_class($this)."::initAsSpecimen"); @@ -1207,7 +1209,7 @@ class Reception extends CommonObject } } - $order=new Commande($this->db); + $order=new CommandeFournisseur($this->db); $order->initAsSpecimen(); // Initialise parametres